Post by sunriser » Fri Jun 01, 2012 12:11 am

Hi all,

I would like the selected gift voucher theme image received by email by the customer to be on the background of the email so that the text will be on top of the image.

Would this be possible?
Anyone got an idea how to approach?

Thanks!

http://www.buddhalife.nl


New member

Posts

Joined
Sun Dec 18, 2011 8:03 pm


Post by dirtboy » Fri Jun 01, 2012 12:38 am

find this file, template > mail >voucher.tpl

you can set the background image using this code

Code: Select all

<body style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;">
change it to

Code: Select all

<body background="URL"; style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; ">
this should set the background image for all vouchers

“Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.”
- Henry Ford


User avatar
Active Member

Posts

Joined
Wed Mar 07, 2012 3:04 pm

Post by sunriser » Fri Jun 01, 2012 12:53 am

Hi there, and many thanks for your reply!

I notice my voucher.tpl is different because it was overwritten by a mod I have "Professional HTML Email Template and Design for Opencart Email".
My content of voucher.tpl:

<p style="font-size:12px"><?php echo $text_greeting; ?></p>
<p style="font-size:12px"><?php echo $text_from; ?></p>

<?php if ($message) { ?>
<p style="font-size:12px"><?php echo $text_message; ?></p>
<p style="font-size:12px"><?php echo $message; ?></p>
<?php } ?>

<p style="font-size:12px"><?php echo $text_redeem; ?></p>
<p style="font-size:12px"><a href="<?php echo $store_url; ?>" title="<?php echo $store_name; ?>"><?php echo $store_url; ?></a></p>

<p style="font-size:12px"><?php echo $text_footer; ?></p>

http://www.buddhalife.nl


New member

Posts

Joined
Sun Dec 18, 2011 8:03 pm


Post by dirtboy » Fri Jun 01, 2012 1:04 am

then just try adding this line of code and see if it works for you

Code: Select all

<body background="URL">

“Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.”
- Henry Ford


User avatar
Active Member

Posts

Joined
Wed Mar 07, 2012 3:04 pm

Post by sunriser » Fri Jun 01, 2012 1:08 am

Will check it out, if it's not working as suspected, I will check with the creator!
Thanks!

http://www.buddhalife.nl


New member

Posts

Joined
Sun Dec 18, 2011 8:03 pm


Post by thbr02 » Fri Jun 01, 2012 2:06 am

It would be nice to set the image to be on the background of the email. I'v tried but can't find the right place for the code. This is how my voucher.tpl loooks like:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $title; ?></title>
<style type="text/css">
body {
	color: #000000;
	font-family: Arial, Helvetica, sans-serif;
}
body, td, th, input, textarea, select, a {
	font-size: 12px;
}
p {
	margin-top: 0px;
	margin-bottom: 20px;
}
a, a:visited, a b {
	color: #378DC1;
	text-decoration: underline;
	cursor: pointer;
}
a:hover {
	text-decoration: none;
}
a img {
	border: none;
}
#container {
	width: 680px;
}
</style>
</head>
<body>
<div id="container">
  <div style="float: right; margin-left: 20px;"><a href="<?php echo $store_url; ?>" title="<?php echo $store_name; ?>"><img src="<?php echo $image; ?>" alt="<?php echo $store_name; ?>" /></a></div>
  <div>
    <p><?php echo $text_greeting; ?></p>
    <p><?php echo $text_from; ?></p>
    <?php if ($message) { ?>
    <p><?php echo $text_message; ?></p>
    <p><?php echo $message; ?></p>
    <?php } ?>
    <p><?php echo $text_redeem; ?></p>
    <p><a href="<?php echo $store_url; ?>" title="<?php echo $store_name; ?>"><?php echo $store_url; ?></a></p>
    <p><?php echo $text_footer; ?></p>
  </div>
</div>
</body>
</html>

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by gocreative » Wed May 22, 2013 11:58 am

It should look something like this (using non-shorthand inline styles wherever possible):

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $title; ?></title>
</head>
<body>

<body style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #000000;">

	<div style="width: 650px; height: 250px; background-image: url('<?php echo $image; ?>'); background-position: top left; background-repeat: no-repeat; margin-bottom: 20px; border: none;">

		<p><?php echo $text_greeting; ?></p>
		<p><?php echo $text_from; ?></p>
		<?php if ($message) { ?>
		<p><?php echo $text_message; ?></p>
			<p><?php echo $message; ?></p>
		<?php } ?>
		<p><?php echo $text_redeem; ?></p>
		<p><a href="<?php echo $store_url; ?>" title="<?php echo $store_name; ?>"><?php echo $store_url; ?></a></p>
		<p><?php echo $text_footer; ?></p>

	</div>

</body>
</html>

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 5:46 pm
Who is online

Users browsing this forum: Bing [Bot] and 17 guests