Page 1 of 1

Gift Voucher theme image

Posted: Fri Jun 01, 2012 12:11 am
by sunriser
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!

Re: Gift Voucher theme image

Posted: Fri Jun 01, 2012 12:38 am
by dirtboy
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

Re: Gift Voucher theme image

Posted: Fri Jun 01, 2012 12:53 am
by sunriser
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>

Re: Gift Voucher theme image

Posted: Fri Jun 01, 2012 1:04 am
by dirtboy
then just try adding this line of code and see if it works for you

Code: Select all

<body background="URL">

Re: Gift Voucher theme image

Posted: Fri Jun 01, 2012 1:08 am
by sunriser
Will check it out, if it's not working as suspected, I will check with the creator!
Thanks!

Re: Gift Voucher theme image

Posted: Fri Jun 01, 2012 2:06 am
by thbr02
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>

Re: Gift Voucher theme image

Posted: Wed May 22, 2013 11:58 am
by gocreative
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>