Order email not sending in magento for customer confirmation? - magento-1.8

Order email not sending in magento for confirmation? After order not send invoice in magento to customer on email kindly help me

Go in "System > Transactional Emails" and create there the translated templates.
And Click ->Add New Template->Template Name-> Paste (Innvoice)->Template Subject Paste({{var store.getFrontendName()}}: Invoice # {{var invoice.increment_id}} for Order # {{var order.increment_id}})
->Template Content Paste
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<!-- [ header starts here] -->
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<tr>
<td valign="top"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></td>
</tr>
<!-- [ middle starts here] -->
<tr>
<td valign="top">
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
<p style="font-size:12px; line-height:16px; margin:0;">
Thank you for your order from {{var store.getFrontendName()}}.
You can check the status of your order by logging into your account.
If you have any questions about your order please contact us at {{config path='trans_email/ident_support/email'}} or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span>.
</p>
</td>
</tr>
<tr>
<td>
<h2 style="font-size:18px; font-weight:normal; margin:0;">Your Invoice #{{var invoice.increment_id}} for Order #{{var order.increment_id}}</h2>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.billing_address.format('html')}}
</td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var payment_html}}
</td>
</tr>
</tbody>
</table>
<br/>
{{depend order.getIsNotVirtual()}}
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<thead>
<tr>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.shipping_address.format('html')}}
</td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
{{var order.shipping_description}}
</td>
</tr>
</tbody>
</table>
<br/>
{{/depend}}
{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}
<p style="font-size:12px; margin:0 10px 10px 0;">{{var comment}}</p>
</td>
</tr>
<tr>
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></strong></p></center></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
And ->Template Styles Paste(body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; })
Go in "System > Configuration > Sales Email" and select for each (Order, Innvoice) created Template from Transactional Email.

Related

TinyMCE paste from excel

I have a problem with TinyMCE editor which I cannot resolve.
If I copy a table from Excel and paste it into the editor it loses the formatting. I have set up extended_valid_elements as follows...
extended_valid_elements:"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],table[style|class|border=2|width|cellspacing|cellpadding|bgcolor],colgroup,col[style|width],tbody,tr[style|class],td[style|class|colspan|rowspan|width|height|background|span|padding],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style|font-family|color]"
The HTML that is saved into the MySQL field is as follows
From Excel ...
<table style="border-collapse: collapse; width: 242pt;" border="2" width="322">
<tbody>
<tr style="height: 14.25pt;">
<td style="height: 14.25pt; width: 105pt;" width="140">Test</td>
<td style="width: 104pt;" width="138"></td>
<td style="width: 33pt;" width="44"> </td>
</tr>
</tbody>
</table>
From Word ...
<table style="width: 242.0pt; border-collapse: collapse;" border="2" width="0">
<tbody>
<tr style="height: 14.25pt;">
<td style="width: 105.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="140">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;">Test</span></p>
</td>
<td style="width: 104.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="139"></td>
<td style="width: 33.0pt; background: #92D050; padding: 0cm 5.4pt 0cm 5.4pt; height: 14.25pt;" width="44">
<p style="margin-bottom: .0001pt; line-height: normal;"><span style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: black;"> </span></p>
</td>
</tr>
</tbody>
</table>
How can I make this work from excel without having to go through word first?
It would appear I have to use power paste which is a paid-for option ... I have a call setup with their sales team to see how much it will cost! Fingers crossed.

How to add a button inside of 1 cell inside a table on SharePoint?

I'm trying to add a button that links out to another website inside of a cell in SharePoint but it keeps moving the button to either above or below the table and not inside of the cell.
Is it possible to do this with either an embed code or an HTML code that I could place within "Edit Source" under "Content Editor"?
Any help on this would be appreciated. I have been researching solutions all day.
The below is currently what is being used. Am I doing something wrong?
<span style="font-size: 10px;">
<font face="Verdana">
<a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx">
<strong>
<input name="HONDA" type="button" value="Case for Change & Sponsorship " style="background-color: #336699; color: #ffffff;"/>
</strong>
</a>
</font>
</span>
<table cellspacing="0" width="100%" class="ms-rteTable-default">
<tbody>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">​<br/>​<br/></td>
<td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
<style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose & Scope</span>​<br/></style="background-color:></td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
</td>
<td class="ms-rteTableOddCol-default">
<p>
<span style="font-family: optima;">•Align to the business strategy</span></p>
<p>
<span style="font-family: optima;">•Align on what success looks like with leader and/ or sponsor</span></p>
</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
<div>​OE </div>
<div> Getting Started & Tracking Progress<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3
<br/></sup>(Complex Change)<br/></td>
<td class="ms-rteTableOddCol-default">​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
<div style="text-align: center;">​Everyday Change </div>
<div style="text-align: center;">(Team Effectiveness)<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>
The following code for your reference.
<table cellspacing="0" width="100%" class="ms-rteTable-default">
<tbody>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">​
<span style="font-size: 10px;">
<font face="Verdana">
<a href="/sites/Global_OE/SitePages/Forms/ByAuthor.aspx">
<strong>
<input name="HONDA" type="button" value="Case for Change & Sponsorship" onclick="window.location.href='/sites/Global_OE/SitePages/Forms/ByAuthor.aspx'" style="background-color: #336699; color: #ffffff;"/>
</strong>
</a>
</font>
</span>
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%; text-align: center;">
<style="background-color: style="font-family: optima;">​<img src="/sites/Global_OE/homepagedraft/SiteAssets/SitePages/Test/Picture1.png" alt="Picture1.png" style="margin: 5px; width: 25px; height: 25px;"/><span class="ms-rteFontSize-4">Diagn​​ose & Scope</span>​<br/></style="background-color:></td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableOddCol-default" style="width: 20%;">
</td>
<td class="ms-rteTableEvenCol-default" style="width: 20%;">
</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
</td>
<td class="ms-rteTableOddCol-default">
<p>
<span style="font-family: optima;">•Align to the business strategy</span></p>
<p>
<span style="font-family: optima;">•Align on what success looks like with leader and/ or sponsor</span></p>
</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">
<div>​OE </div>
<div> Getting Started & Tracking Progress<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​​​​​​​​​​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Change Management<sup>3
<br/></sup>(Complex Change)<br/></td>
<td class="ms-rteTableOddCol-default">​<br/></td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​Organization Design<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableOddRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px;">
<div style="text-align: center;">​Everyday Change </div>
<div style="text-align: center;">(Team Effectiveness)<br/></div>
</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
<tr class="ms-rteTableEvenRow-default">
<td class="ms-rteTableEvenCol-default" style="width: 206px; text-align: center;">​​Process Enablement<br/></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>

Building a Custom Report from a saved search using the "Advanced PDF/Template" Editor

I'm building a printable Report based off a saved search to group and subtotal multiple Lots and inventory Detail listing it under each item and displaying the subtotal below each group of items.
I can format the code properly to display 1 item at a time using this
<#if results?has_content>
<table class="itemtable" dir="ltr" style="width:100%;"><!-- start items --><#list results as result><tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
<tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#list><!-- end items --></table>
</#if>
</body>
</pdf>
I'm on the right track to getting the results I want in the PDF but when I Attempt to add <#if> and <#else> tags to group the items It will save but then generate an Unexpected Error when I attempt to print it.
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<macrolist>
<macro id="nlheader">
${preferences.formlandscape}
<table class="header" style="width:100%;"><tr>
<td colspan="3" style="text-align: left; vertical-align: top; white-space: nowrap; height: 40px; width: 178px;"><span style="font-size:12px;"><strong>Date:</strong></span></td>
<td colspan="5" style="text-align: center; vertical-align: middle; white-space: nowrap; height: 40px; width: 400px;"><span style="font-size:12px;"><strong>Hofseth North America<br />In Stock Inventory Report sorted by Item<br />For All Items Available All Locations</strong></span></td>
<td colspan="3" style="text-align: right; vertical-align: top; white-space: nowrap; height: 40px;"><span style="font-size:12px;"><strong>Page:<pagenumber/> of <totalpages/></strong></span></td>
</tr></table>
<table boarder="1" class="header" style="width:100%;">
<thead>
<tr>
<th style="width: 40px;"><span style="font-size:12px;">Pack Size</span></th>
<th style="width: 55px;"><span style="font-size:12px;">Load #</span></th>
<th style="width: 75px;"><span style="font-size:12px;">Brand</span></th>
<th style="width: 50px;"><span style="font-size:12px;">Exp. Date</span></th>
<th style="width: 90px;"><span style="font-size:12px;">Lot #</span></th>
<th style="width: 100px;"><span style="font-size:12px;">Location</span></th>
<th style="width: 65px;"><span style="font-size:12px;">Arrival<br />Date</span></th>
<th style="width: 69px;"><span style="font-size:12px;">Unit<br />Cost</span></th>
<th style="width: 110px;"><span style="font-size:12px;">Extended<br />Cost</span></th>
<th style="width: 70px;"><span style="font-size:12px;">Qty<br />Available</span></th>
<th style="width: 64px;"><span style="font-size:12px;">Units<br />Available</span></th>
</tr>
</thead>
</table>
</macro>
</macrolist>
<style type="text/css">* {
<#if .locale == "zh_CN">
font-family: NotoSans, NotoSansCJKsc, sans-serif;
<#elseif .locale == "zh_TW">
font-family: NotoSans, NotoSansCJKtc, sans-serif;
<#elseif .locale == "ja_JP">
font-family: NotoSans, NotoSansCJKjp, sans-serif;
<#elseif .locale == "ko_KR">
font-family: NotoSans, NotoSansCJKkr, sans-serif;
<#elseif .locale == "th_TH">
font-family: NotoSans, NotoSansThai, sans-serif;
<#else>
font-family: NotoSans, sans-serif;
</#if>
}
table {
font-size: 9pt;
}
th {
font-weight: bold;
font-size: 8pt;
vertical-align: middle;
padding: 5px 6px 3px;
background-color: #e3e3e3;
color: #333333;
}
td {
padding: 4px 6px;
}
td p { align:left }
</style>
</head>
<body header="nlheader" header-height="15%" padding="0.2in 0.2in 0.2in 0.2in" size="Letter-LANDSCAPE">
<#if results?has_content><#assign subtotalEC = 0 subtotalLB = 0 subtotalCS = 0>
<table class="itemtable" style="width:100%;"><!-- start items --><#list results as result><#list result.itemid as items>
<tr>
<td style="width: 43px;"><span style="font-size:10px;">**</span></td>
<td colspan="2" rowspan="1" style="width: 70px;"><span style="font-size:10px;">${result.itemid}</span></td>
<td colspan="2" rowspan="1" style="width: 94px; white-space: nowrap;"><span style="font-size:10px;">${result.displayname}</span></td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;"> </td>
<td style="width: 79px;"> </td>
<td style="width: 68px;"> </td>
</tr>
<#elseif><tr>
<td style="width: 43px;"><span style="font-size:10px;">${result.custitempacksize}</span></td>
<td style="width: 70px;"><span style="font-size:10px;">${result.custcol_lottextitemlinelevel}</span></td>
<td style="width: 48px;"><span style="font-size:10px;">${result.custitem_brand}</span></td>
<td style="width: 94px;">${result.expirationdate}</td>
<td style="width: 97px;"><span style="font-size:10px;">${result.serialnumbers}</span></td>
<td style="width: 133px;"><span style="font-size:10px;">${result.location}</span></td>
<td style="width: 72px;"><span style="font-size:10px;">${result.custbodyestimatedarrivaldate}</span></td>
<td style="width: 47px;"><span style="font-size:10px;">${result.rate}</span></td>
<td style="width: 120px;"><span style="font-size:10px;">${result.formulacurrency}</span></td>
<td style="width: 79px;"><span style="font-size:10px;">${result.quantityavailable}</span></td>
<td style="width: 68px;"><span style="font-size:10px;">${result.formulanumeric}</span></td>
</tr>
</#elseif></#list>
<#else><tr>
<td style="width: 43px;">**</td>
<td colspan="3" rowspan="1" style="width: 70px;">Subtotal for : ${result.itemid}</td>
<td style="width: 97px;"> </td>
<td style="width: 133px;"> </td>
<td style="width: 72px;"> </td>
<td style="width: 47px;"> </td>
<td style="width: 120px;">
<hr />{subtotalEC}</td>
<td style="width: 79px;">
<hr />{subtotalLB}</td>
<td style="width: 68px;">
<hr />{subtotalCS}</td>
</tr>
</#else></#list><!-- end items --></table>
</#if>
</body>
</pdf>
I cannot get it to create the list I want using freemarker tags.
The code I've supplied saves with no errors
but then generates an unknown error when trying to print
or display it as PDF from the UI.
I would like the following to happen.
Have the report Group and list all items.
Under each Item List the Line level detailed information contained in the search from that item.
Subtotal 3 fields from the Grouped Info under each item and display it under the last Line of Grouped Information.
Then repeat for all items contained in the search
It might be finicky about your if-else structure.
You are closing the tags for the else-ifs and else's, where it might not like that.
Here's an example from the freemarker website:
<#if x == 1>
x is 1
<#elseif x == 2>
x is 2
<#elseif x == 3>
x is 3
<#elseif x == 4>
x is 4
<#else>
x is not 1 nor 2 nor 3 nor 4
< /#if>
Worth a try!

Key error on text formatting even after double brackets used on Python 3

I want to format a text which is html content which will be embedded to an email. I'm preparing the mail with Python 3.
I know that in Python text formatting can be performed by using "f" before the text to be formatted and then key values are written with single brackets like {key}.
Text I'm formatting is;
html = f"""
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style type="text/css">
body {{width: 100% !important;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
margin: 0;
padding: 0;}}
/* force default font sizes */
.ExternalClass {{width: 100%;}}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {{
line-height: 100%;
}}
/* Hotmail */
table td {{border-collapse: collapse;}}
#media only screen and (min-width: 600px) {{
.maxW {{
width: 600px !important;
}}
}}
</style>
</head>
<body style="margin: 0px; padding: 0px; -webkit-text-size-adjust:none; -ms-
text-size-adjust:none;" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<table bgcolor="#CCCCCC" width="100%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="100%" class="maxW" style="max-width: 100%; margin: auto;" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center" valign="middle" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 24px; color: #353535; padding:3%; padding-top:40px; padding-bottom:40px;">
{months[now.month-1]} Ayı Jira Raporu
</td>
</tr>
<tr>
<td align="left" valign="middle" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 24px; color: #353; padding:3%; padding-top:40px; padding-bottom:40px;">
Genel Durum
</td>
</tr>
<tr>
<td align="center">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" align="center">
<br>
<img src="cid:image1">
<br>
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#252525" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #EEEEEE; padding:10px; padding-right:0;">
Grup
</td>
<td width="30%" align="right" bgcolor="#252525" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #EEEEEE; padding:10px; padding-left:0;">
Talep Sayısı
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-right:0;">
YY Ankara
</td>
<td width="30%" align="right" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:0;">
{len(yy_ankara_issues)}
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#EEEEEE" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-right:0;">
IG Ankara
</td>
<td width="30%" align="right" bgcolor="#EEEEEE" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:0;">
{len(ig_ankara_issues)}
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-right:0;">
YY İstanbul
</td>
<td width="30%" align="right" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:0;">
{len(yy_istanbul_issues)}
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:10px;">
<b>Toplam Açılan Talep Sayısı</b>
</td>
<td width="30%" align="right" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:0;">
<b>{len(all_issues)}</b>
</td>
</tr>
<tr>
<td width="70%" align="left" bgcolor="#FFFFFF" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #252525; padding:10px; padding-left:10px;">
Bu ay açılan talepler ortalama
<b> {len(all_closed_issues)} </b> günde kapanmıştır.
</td>
</tr>
</table>
</td>
</tr>
</td>
<tr>
<td align="center">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="70%" align="left" bgcolor="#252525" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #EEEEEE; padding:10px; padding-right:0;">
Talep Önceliğine Göre Talep Sayıları
</td>
<td width="30%" align="right" bgcolor="#252525" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 12px; color: #EEEEEE; padding:10px; padding-left:0;">
Talep Sayısı
</td>
</tr>
</table>
</td>
</tr>
</td>
</tr>
</tr>
</table>
<tr>
<td align="left" align="middle" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 14px; color: #353535; padding:3%; padding-top:40px; padding-bottom:40px;">
İyi Çalışmalar
</td>
</tr>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
"""
Then I'm using tabulate to iteratively create tables;
html = html.format(table=tabulate(data, tablefmt="html"))
At this point Python gives the keyError.
HTML styling uses lots of brackets, but I've doubled all brackets in styling. So why I'm still having this keyError ?

Gmail override font color

My code :
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;">
SELLE ZETA CONFORT GEL
</td>
</tr>
When i try on different mail client, the text is black, but on gmail (explorer,chrome and firefox) this text is blue.
How can i fix this?
If you want to look an exemple:
http://issl.fr/test/test_validator.html
Take all the code html and copy it there :
https://litmus.com/email-testing
You will be able to have a preview on every client. Look the gmail one.
Because your text is sitting in an <a> tag (your <a> is wrapping the table with your text in it). That's why your text is turning to blue. Apply a color to your <a> and that should solve it... John is right to use a proper hex code for the color.
As well, Gmail likes to change color:#000000 on links to default blue even if you state that it should be color:#000000. Use color:#000001. That will solve it.
With gmail you need to be redundant on your colors.
Not only would you have to declare a color with in the but you should also wrap it in a span with the color as well.
This is one of your items below with the correct code:
<Track Link>
<a style="text-decoration : none; color:#000000;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody>
<tr height="3"></tr><tr style="height : 32px !important; min-height : 32px !important; max-height : 32px !important; ">
<td width="6"></td>
<td align="left">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "></div>
</td>
<td width="58"></td>
<td align="right">
<div style="height :32px !important; min-height : 32px !important; max-height : 32px !important; "><img border="0" style="display:block;" width="64" height="32" alt=" " src="http://decathlonbe.net/images/Marques/geonaute.png"></div>
</td>
<td width="6"></td>
</tr><tr height="1"></tr>
</tbody></table>
</td></tr>
<tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td align="center">
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="5"></td>
<td><img width="188" border="0" alt="" src="http://www.decathlon.be/media/805/8052361/classic_400PX_asset_71685950.jpg" style="display : block;"></td>
<td width="5"></td>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-weight : bold;font-family:Arial; color:black;"><span style="color:#000000;">SELLE ZETA CONFORT GEL</span></td>
</tr>
<tr>
<td align="center" style="font-size:9pt; font-family:Arial; color:#6f6f6f;"></td>
</tr>
</tbody></table>
</td></tr><tr><td>
<div class="price" style="font-family : Arial; font-size : 22pt; color : black; text-align : center;"><div class="nopromo" style="font-weight:bold;font-family : Arial; font-size : 19pt; color : black; text-align : center;">29<sup style="font-size:12pt;">€95</sup></div></div>
</td></tr><tr><td>
<table height="100%" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>
<tr>
<td width="15"></td>
<td valign="middle" align="center">
<Track Link><a style="text-decoration : none; font-family : Arial; font-weight : bold; font-size : 11pt; color : white;" href="http://www.decathlon.be/selle-zeta-confort-gel-id_8052361.html"><table align="center" cellspacing="0" cellpadding="0" border="0" style="background : #efefef;" >
<tr height="32" style="background-color : #FF7100;">
<td width="5" ><span style="color: #FF7100;">i<span></td>
<td style = "max-width: 144px;"> <div style="color : white;text-align:center; font-size : 10pt;font-family:Arial;font-weight: bold; ">sefsefse </div></td>
<td style="padding-left : 5px;">
<span style="color : white; font-weight : bold; font-size : 12pt;"> > </span>
</td>
<td width="5"><span style="color: #FF7100;">i</span></td>
</tr>
</table>
</a></Track Link>
</td>
<td width="15"></td>
</tr>
<tr height="8"></tr>
</tbody></table>
</td></tr>
</tbody></table>
</a>
In email you must use the 6-digit hex codes for maximum compatibility across email clients. Use CSS for text ie: color:#000000;, and html's bgcolor="#FFFFFF" for backgrounds
Darryl Vos's Answer is correct.
I style links with color:#00001 to achieve a black link in emails all the time.
I work in an agency and no one has ever complained it does not look black.

Resources