Here are the layouts I am using:
maillayout.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title> {{if response.title:}}{{=response.title}}{{else:}}
{{=URL(r=request)}}{{pass}} </title>
</head>
<body>
<style type="text/css" media="screen">
{{include 'css.html'}}
</style>
{{domain='http://www.fitwise.nl'}}
<table class="bg1" width="100%" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<td align="center">
<table class="bg2" width="600" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<td class="browserversion" align="left">
<p>Having trouble viewing this email? {{=A('View
it in your browser', _href=domain +
URL(r=request,f='browser_version',args=[item.company_id]),
_target="_blank")}}</p>
</td>
</tr>
<tr>
<td class="header" align="left">
<img src="http://www.images.fitwise.nl/
crm_header.jpg" alt="Header" width="600" height="192" />
</td>
</tr>
<tr>
<td valign="top" class="body">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<td class="content" valign="top"
align="left">
<h2>Fitwise</h2>
{{include}}
<p class="signature"><br />Kind
regards,<br />
<br />Team Fitwise
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="footer" valign="middle" align="left"
height="61">
<p>Not interested anymore? {{=A('Unsubscribe',
_href=domain +
URL(r=request,c='default',f='unsubscribe',args=[item.company_id,'logomail']),
_target="_blank")}}</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
mail.html
{{extend 'maillayout.html'}}
<p>Text ...</p>
<p>Text ... </p>
etc.
css.html
body {
background-color: #EEEEEE;
}
table.bg1 {
background-color: #EEEEEE;
}
table.bg2 {
background-color: #FFFFFF;
}
td.browserversion {
background-color: #EEEEEE;
padding: 9px 24px 9px 24px;
}
td.browserversion p {
color: #444444;
font-family: Arial;
font-size: 11px;
font-weight: normal;
margin: 0;
padding: 0;
}
td.browserversion p a {
color: #444444;
font-family: Arial;
font-size: 11px;
font-weight: normal;
text-decoration: underline;
}
td.body {
background-color: #FFFFFF;
padding: 24px 24px 24px 24px;
}
td.content {
margin: 0;
padding: 0px 24px 0px 24px;
}
td.content h2 {
color: #4169E1;
font-family: Arial;
font-size: 16px;
font-weight: bold;
margin: 0;
padding: 0;
}
td.content p, .data td {
color: #444444;
font-family: Arial;
font-size: 13px;
font-weight: normal;
margin: 12px 0 12px 0;
padding: 0;
}
td.content p a, .data td a {
color: #4169E1;
font-family: Arial;
font-size: 13px;
font-weight: normal;
text-decoration: none;
}
td.content ul li {
color: #444444;
font-family: Arial;
font-size: 13px;
font-weight: normal;
}
td.content p.signature {
font-family: Arial;
font-size: 13px;
font-weight: normal;
text-align: right;
padding: 0 24px 0 0;
}
td.footer {
background-color: #AAAAAA;
text-align: center;
height: 36px;
vertical-align: middle;
}
td.footer p {
color: #FFFFFF;
font-family: Arial;
font-size: 11px;
font-weight: normal;
margin: 0;
padding: 0;
}
td.footer p a {
color: #FFFFFF;
font-family: Arial;
font-size: 11px;
font-weight: normal;
text-decoration: underline;
}
You need: {{domain='http://www.fitwise.nl'}} because the recipient of
the email doesn't know the hostname. See this post for comments on
this solution:
http://groups.google.com/group/web2py/browse_thread/thread/917e56e86ee973d/6ad92427381358ac
Since, for the time being, this works for me I so far didn't bother to
implement a better solution.
The browser version of the mail is similar to this one except that
it's adjusted to display in a browser.
Kind regards,
Annet.