Rythm template engine in websphere - rythm

I have the following template for generation of an email.
#import java.text.SimpleDateFormat
#import com.sydneywater.otc.persistence.*
#import java.text.NumberFormat
#args(){
com.sydneywater.otc.persistence.Application application
}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style>
table {
font-family: Segoe UI, Verdana, Arial, helvetica, sans-serif;
font-size: 14px;
background-color: #FFFFFF;
}
th {
margin-left: 5px;
margin-right: 5px;
text-align: left;
}
td {
margin-left: 5px;
margin-right: 5px;
background-color: #E5E5E5;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th colspan="2" style="color: white" bgcolor="#7BB9E3">Applicant Details</th>
</tr>
<tr>
<td>Applicant Name</td>
<td>#application.getApplicant().getApplicantName()</td>
</tr><tr>
<td>Applicant Address</td>
<td>#application.getApplicant().getFormattedAddress()</td>
</tr><tr>
<td>Date Submitted</td>
#{
SimpleDateFormat stdFormat = new SimpleDateFormat("dd/MM/yyyy");
String formattedDt = stdFormat.format( application.getDateCreated() );
}
<td>#formattedDt</td>
</tr>
<tr>
<th colspan="2" style="color: white" bgcolor="#7BB9E3">Property & Application Details</th>
</tr>
<tr>
<td>Applicant Number</td>
<td>#application.getId()</td>
</tr>
<tr>
<td>Applicant Name</td>
<td>#application.getApplicationType()</td>
</tr>
<tr>
<td>Asset Number</td>
<td>#application.getAsset().getAssetNo()</td>
</tr>
<tr>
<td>Asset Size (mm)</td>
<td>#application.getAsset().getAssetSize()</td>
</tr>
<tr>
<td>Asset Material</td>
<td>#application.getAsset().getMaterialType()</td>
</tr>
#{
NumberFormat fmt = NumberFormat.getCurrencyInstance();
double totalRetail = 0.0;
double gst = 0.0;
double total = 0.0;
for (ApplicationBilling billing: application.getApplicationBilling()) {
totalRetail += billing.getRetailAmount();
gst += billing.getGst();
}
total = totalRetail + gst;
}
<tr>
<td>Cost</td>
#{
String retailFormatted = fmt.format(totalRetail)
}
<td>#retailFormatted</td>
</tr>
<tr>
<td>GST</td>
#{
String gstFormatted = fmt.format(gst);
}
<td>#gstFormatted</td>
</tr>
<tr>
<td>Total</td>
#{
String totalFormatted = fmt.format(total);
}
<td>#totalFormatted</td>
</tr>
#if (!application.getIsAutoApprovable() ) {
<tr>
<td>Turnaround time</td>
<td>To be implemented</td>
</tr>
}
</table>
</body>
</html>
This is working fine in Tomcat 7 but when I deploy the application as WAR package I get the below error. Does anyone know a fix for this?
Thanks
**Error 500: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.rythmengine.exception.CompileException: Syntax error on token "class", # expected**
Template: C:/Program Files (x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/HWJ4TY10Node05Cell/otc-services-0_0_1-SNAPSHOT_war.ear/otc-services-0.0.1-SNAPSHOT.war/WEB-INF/classes/template/email/submit_notify.html
Relevant template source lines:
-------------------------------------------------
1: #import java.text.SimpleDateFormat
2: #import com.sydneywater.otc.persistence.*
3: #import java.text.NumberFormat
4: #args(){
5: com.sydneywater.otc.persistence.Application application
6: }
7: <html>
8: <head>
9: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
10: <title></title>
11: <style>
12: table {
13: font-family: Segoe UI, Verdana, Arial, helvetica, sans-serif;
14: font-size: 14px;
15: background-color: #FFFFFF;
16: }
17:
18: th {
19: margin-left: 5px;
20: margin-right: 5px;
21: text-align: left;
22: }
23:
24: td {
25: margin-left: 5px;
26: margin-right: 5px;
27: background-color: #E5E5E5;
28: }
29: </style>
30: </head>
31: <body>
32: <table style="width:100%">
33: <tr>
34: <th colspan="2" style="color: white" bgcolor="#7BB9E3">Applicant Details</th>
35: </tr>
36:
37: <tr>
38: <td>Applicant Name</td>
39: <td>#application.getApplicant().getApplicantName()</td>
40: </tr><tr>
41: <td>Applicant Address</td>
42: <td>#application.getApplicant().getFormattedAddress()</td>
43: </tr><tr>
44: <td>Date Submitted</td>
45: #{
46: SimpleDateFormat stdFormat = new SimpleDateFormat("dd/MM/yyyy");
47: String formattedDt = stdFormat.format( application.getDateCreated() );
48: }
49: <td>#formattedDt</td>
50: </tr>
51: <tr>
52: <th colspan="2" style="color: white" bgcolor="#7BB9E3">Property & Application Details</th>
53: </tr>
54: <tr>
55: <td>Applicant Number</td>
56: <td>#application.getId()</td>
57: </tr>
58: <tr>
59: <td>Applicant Name</td>
60: <td>#application.getApplicationType()</td>
61: </tr>
62: <tr>
63: <td>Asset Number</td>
64: <td>#application.getAsset().getAssetNo()</td>
65: </tr>
66: <tr>
67: <td>Asset Size (mm)</td>
68: <td>#application.getAsset().getAssetSize()</td>
69: </tr>
70: <tr>
71: <td>Asset Material</td>
72: <td>#application.getAsset().getMaterialType()</td>
73: </tr>
74: #{
75: NumberFormat fmt = NumberFormat.getCurrencyInstance();
76: double totalRetail = 0.0;
77: double gst = 0.0;
78: double total = 0.0;
79: for (ApplicationBilling billing: application.getApplicationBilling()) {
80: totalRetail += billing.getRetailAmount();
81: gst += billing.getGst();
82: }
83: total = totalRetail + gst;
84: }
85: <tr>
86: <td>Cost</td>
87: #{
88: String retailFormatted = fmt.format(totalRetail)
89: }
90: <td>#retailFormatted</td>
91: </tr>
92: <tr>
93: <td>GST</td>
94: #{
95: String gstFormatted = fmt.format(gst);
96: }
97: <td>#gstFormatted</td>
98: </tr>
99: <tr>
100: <td>Total</td>
101: #{
102: String totalFormatted = fmt.format(total);
103: }
104: <td>#totalFormatted</td>
105: </tr>
106: #if (!application.getIsAutoApprovable() ) {
107: <tr>
108: <td>Turnaround time</td>
109: <td>To be implemented</td>
110: </tr>
111: }
112: </table>
113:
114: </body>
115: </html>

Related

How to get a Json response from alfresco

I'm trying to get an alfresco json response but so far i'm getting this kind of response
for an endpoint as such :
https://exaple.com/alfresco/webdav/Directory1/subDirectory1/
<html>
<head>
<meta content="HTML Tidy for Java (vers. 26 sept. 2004), see www.w3.org" name="generator"/>
<title>Alfresco Content Repository</title>
<style type="text/css">body { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
table { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
.listingTable { border: solid black 1px; }
.textCommand { font-family: verdana; font-size: 10pt; }
.textLocation { font-family: verdana; font-size: 11pt; font-weight: bold; color: #2a568f; }
.textData { font-family: verdana; font-size: 10pt; }
.tableHeading { font-family: verdana; font-size: 10pt; font-weight: bold; color: white; background-color: #2a568f; }
.rowOdd { background-color: #eeeeee; }
.rowEven { background-color: #dddddd; }</style>
</head>
<body>
<table width="100%" border="0" cellpadding="3" cellspacing="2">
<tr>
<td class="textLocation" colspan="4">Directory listing for /Directory1/subDirectory1</td>
</tr>
<tr>
<td colspan="4" height="10"/>
</tr>
</table>
<table class="listingTable" width="100%" border="0" cellpadding="3" cellspacing="2">
<tr>
<td width="*" class="tableHeading">Name</td>
<td width="10%" class="tableHeading">Size</td>
<td width="20%" class="tableHeading">Type</td>
<td width="25%" class="tableHeading">Modified Date</td>
</tr>
<tr class="rowOdd">
<td class="textData" colspan="4">
[Up a level]
</td>
</tr>
<tr class="rowEven">
<td class="textData">
File.ini
</td>
<td class="textData">21.7 Kb</td>
<td class="textData">Plain Text</td>
<td class="textData">Thu, 09 Jan 2020 11:51:45 GMT</td>
</tr>
<tr class="rowOdd">
<td class="textData">
File2.OLB
</td>
<td class="textData">502.2 Kb</td>
<td class="textData">application/x-tika-msoffice</td>
<td class="textData">Tue, 09 Nov 2021 08:00:35 GMT</td>
</tr>
</table>
</body>
</html>
How could i get a json response other a html one .
I'n forms i'm reading about cmis but couldn't find a response
When i use CMIS , with this endpoint
https://exaple.com/alfresco/api/-default-/public/cmis/versions/1.1/atom
I'm getting this response :
<html>
<h1>Axis HTTP Servlet</h1>
Hi, you have reached the AXIS HTTP Servlet. Normally you would be hitting this URL with a SOAP client rather than a
browser.
<p>In case you are interested, my AXIS transport name appears to be '<b>http</b>'
</html>
Note , i didn't specified a folder
I'm new to alfresco

Nested Table Width - Outlook Email

I've created an email template which is rendering incorrectly on Outlook Desktop for Windows (2016, 2019).
The entire layout is a single table, with different parts of the email taking up a row (<tr>).
I have two nested tables, each in their own <tr>, with the exact same markup. When I tested it out on Litmus, the second table is narrower than the first.
How the email is rendered:
The markup:
<!DOCTYPE html>
<html lang="">
<style>
body {
padding: 20px;
font-family: Arial, Helvetica, sans-serif;
}
p {
margin: 0;
}
center {
padding: 20px;
background-color: lightyellow;
border: .1px solid gray;
}
center p {
margin: 5px 0;
}
.red {
color: red;
}
.align-center {
text-align: center;
}
.align-end {
text-align: end;
}
.dataTableContainer {
width: 100%;
text-align: left;
}
.dataTable {
width: 100%;
font-size: 14px;
border-collapse: collapse;
border: 0.5px solid gray;
}
.dataTable th, .dataTable td {
text-align: left;
border: 0.1px solid gray;
padding: 8px 5px;
}
.dataTable tr {
font-size: 14px;
mso-line-height-rule: exactly;
line-height: 90%;
}
.dataTable tr:nth-of-type(even) {
background-color: #f2f2f2;
}
.dataTable thead tr th {
border-bottom: 2px solid gray;
}
.dataTable thead tr {
background-color: #f2f2f2;
}
.footerCell {
text-align: center;
}
.brand {
font-size: 12px;
letter-spacing: 5px;
}
.main_brand {
font-size: 18px;
font-weight: bold;
font-style: italic;
letter-spacing: 1.8px;
}
.main_brand span {
font-size: 15px;
font-weight: initial;
}
</style>
<body>
<table width="100%">
<tr width="100%">
<td>
<p>Dear Customer,</p>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td>
<center>
<p class="red">
<b>YOU HAVE ACCOUNTS WHICH ARE PAST DUE</b>
</p>
<p>The below orders are scheduled to ship in the next few days and are</p>
<p class="red">
<b>AT RISK DUE TO CUSTOMER PAST DUE BALANCE</b>
</p>
<p>
In order to avoid delays, please collect payment ASAP. These orders will not be released until payment is received
</p>
<p>
Click the link below to view the customer statement
</p>
</center>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td class='dataTableContainer'>
<table cellpadding="0" cellspacing="0" class="dataTable" style="width:100%;">
<thead>
<tr>
<th><b>Order #</b></th>
<th><b>Status</b></th>
<th><b>Customer Name</b></th>
<th><b>Req Ship Date</b></th>
<th><b>Account Due</b></th>
<th><b>Account Past Due</b></th>
<th><b>Statement URL</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td class='dataTableContainer'>
<table cellpadding="0" cellspacing="0" class="dataTable" style="width:100%;">
<thead>
<tr>
<th><b>Order #</b></th>
<th><b>Status</b></th>
<th><b>Customer Name</b></th>
<th><b>Req Ship Date</b></th>
<th><b>Account Due</b></th>
<th><b>Account Past Due</b></th>
<th><b>Statement URL</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>
Through trial and error I found the incriminating line of CSS.
body {
padding: 20px;
}
padding on the body was causing the second table to get narrower than the first. Replacing padding with margin did the trick.
I still have no idea why padding is causing trouble.

Is it possible to have two background images behind text?

I'm trying to achieve an email design where there's text over an image, but that table is on top of 2 background colors. I used a white space image for that effect but I think the outlook hack is not working because I'm using 2 background images.
Does anyone have an idea what I can do? Maybe a CSS trick for the white space?
This is what I want to see:
(https://ibb.co/fQzPSDV)
But my results are all over the place.
<table class="mktoModule module_wrapper m_header mktoModule module_wrapper m_header" id="header2" style="border-spacing: 0; border-collapse: collapse;" align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td class="module" style="mso-line-height-rule: exactly;-webkit-hyphens: none;-moz-hyphens: none;hyphens: none;border-collapse: collapse;word-break: break-word;background-image:https://campaign.yougov.com/rs/060-QFD-941/images/whitespace.png;padding-left: 0;background-position:top center;background-size:auto;background-color:#9078d7;padding-top: 0;padding-right: 0;padding-bottom: 0;background-repeat: repeat-x ;background:https://campaign.yougov.com/rs/060-QFD-941/images/whitespace.png;" valign="top" bgcolor="#9078d7" background="https://campaign.yougov.com/rs/060-QFD-941/images/whitespace.png">
<center>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:800px;height:120px">
<v:fill type="frame" src="https://campaign.yougov.com/rs/060-QFD-941/images/whitespace.png" color="#9078d7" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<div><div style="font-size: 0;line-height: 0;margin: 0;border: 0">
<![endif]-->
<table class="table600" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto;" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody>
<tr>
<td class="module" style="mso-line-height-rule: exactly;-webkit-hyphens: none;-moz-hyphens: none;hyphens: none;border-collapse: collapse;word-break: break-word;background-image:https://campaign.yougov.com/rs/060-QFD-941/images/templatebg.jpg;padding-left: 0;background-position:top center;background-size:auto;background-color:#7C64C3;padding-top: 0;padding-right: 0;padding-bottom: 0;background-repeat: repeat-x ;background:https://campaign.yougov.com/rs/060-QFD-941/images/templatebg.jpg;" valign="top" bgcolor="#7C64C3" background="https://campaign.yougov.com/rs/060-QFD-941/images/templatebg.jpg">
<center>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="false" stroke="false" style="width:600px;height:300px">
<v:fill type="frame" src="https://campaign.yougov.com/rs/060-QFD-941/images/templatebg.jpg" color="#7C64C3" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<div><div style="font-size: 0;line-height: 0;margin: 0;border: 0">
<![endif]-->
<table>
<tbody>
<tr>
<td class="bgImgSpace" style="word-break: break-word; -webkit-hyphens: none; -moz-hyphens: none; hyphens: none; border-collapse: collapse; mso-line-height-rule: exactly; line-height: 155px; font-size: 155px;" height="155"> </td>
</tr>
<tr>
<td>
<table class="table600" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: collapse; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto;" align="center" border="0" cellpadding="0" cellspacing="0" width="500">
<tbody>
<tr>
<td class="primary-font title" style="-moz-hyphens: none;-webkit-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;word-break: break-word;-webkit-hyphens: none;-ms-text-size-adjust: 100%;hyphens: none;text-align: left;font-family: Arial, sans-serif;font-weight: bold;font-size: 24px;border-collapse: collapse;line-height:26px;color:#ffffff;">
<div class="mktoText" id="heroText2">
Make money online through advertising
</div> </td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td class="bgImgSpace" style="word-break: break-word; -webkit-hyphens: none; -moz-hyphens: none; hyphens: none; border-collapse: collapse; mso-line-height-rule: exactly; line-height: 35px; font-size: 35px;" height="35"> </td>
</tr>
</tbody>
</table>
<!--[if gte mso 9]></div></div>
</v:textbox>
</v:rect>
<![endif]-->
</center> </td>
</tr>
</tbody>
</table>
<!--[if gte mso 9]></div></div>
</v:textbox>
</v:rect>
<![endif]-->
</center> </td>
</tr>
</tbody>
</table>
Thanks for anyone who can help.

Unable to send embedded image in email using FluentEmail

I'm using FluentEmail in ASP.NET core 2.0 class library which will be sending the Email notification.
Below is the sample code I have tried till now:
using FluentEmail.Core;
using FluentEmail.Razor;
using FluentEmail.Smtp;
using System;
using System.IO;
using System.Net.Mail;
using System.Net.Mime;
namespace FluentEmail
{
public class EmailNotification : IEmailNotification
{
public bool SendEmailNotification()
{
try
{
//Setup Default sender befault sending the email.
SmtpClient smtpClient = new SmtpClient
{
Host = "smtp.office365.com",
Port = 587,
EnableSsl = true,
Credentials = new System.Net.NetworkCredential("username", "Password")
};
Email.DefaultSender = new SmtpSender(smtpClient);
Email.DefaultRenderer = new RazorRenderer();
string imagePath = #"C:\Users\pratik.soni\Downloads\FluentLogo.png";
Stream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
stream.Flush();
stream.Seek(0, SeekOrigin.Begin);
var attachment = new Core.Models.Attachment()
{
Data = stream,
ContentType = "image/png",
Filename = "FluentLogo.png",
IsInline = true
};
var email = Email
.From("pratik.soni#1rivet.com")
.To("pratik.soni10#gmail.com")
.Subject("Test")
.Body("<html>Inline image here: <img src=\"cid:FluentLogo.png\">" +
"<p>You should see an image without an attachment, or without a download prompt, dependig on the email client.</p></html>", true);
email.Attach(attachment);
email.Send();
return true;
}
catch (Exception ex)
{
return false;
}
}
}
}
My HTML file is as follow:
<!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>FluentEmail - Test with template and attachment</title>
</head>
<body style="margin: 0; padding: 0; background-color: #e5e5e5;" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0">
<!--100% body table-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#d8e7ea" style="background-color: #e5e5e5;">
<!--intro-->
<table width="620" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" width="11" height="100"></td>
<td valign="middle" height="100">
<!--break-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"></td>
</tr>
</table>
<!--/break-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="59%" height="100">
<table width="280" border="0" cellspacing="0" cellpadding="20">
<tr>
<td bgcolor="#333333">
<h1 style="font-family: Arial, Helvetica, sans-serif; font-size: 42px; margin: 0; padding: 0; color: #fff;">Typographic</h1>
<p style="text-transform: uppercase; font-size: 14px; color: #fff; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;">
<currentdayname>
<currentday>
<currentmonthname>
<currentyear>
</p>
</td>
</tr>
</table>
</td>
<td width="41%" height="100" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" height="70">
<p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333; text-transform: uppercase; margin: 0; padding: 0;"> Email not looking beautiful?<br>
<webversion style="text-decoration: none; color: #cc0000">View it in your browser</webversion>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--break-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"></td>
</tr>
</table>
<!--/break-->
</td>
</tr>
</table>
<!--/intro-->
<!--content section-->
<table width="620" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="82" width="11" valign="middle"></td>
<td height="82" bgcolor="#FFFFFF" valign="middle">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" height="37" bgcolor="#fef041">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#ffffff" width="25" height="37"></td>
<td width="15" height="37"></td>
<td>
<h2 style="color: #333333 !important; font-size: 21px; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 0; text-shadow: 1px 1px 1px #fff;"> #Model.Title</h2>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top"></td>
<td bgcolor="#FFFFFF" valign="top">
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<p style="font-size: 14px; color: #333333; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;"> Dear #Model.Name, You are totally #Model.Compliment. </p>
<br>
<table bgcolor="#000000" width="540" border="0" cellspacing="10" cellpadding="0">
<tr>
<td>
<img src=\"cid:#Model.ImgSrc\">
</td>
</tr>
<tr>
<td width="540" height="158"><img style="margin: 0; padding: 0; display: block;" border="0" src="C:\Users\pratik.soni\Downloads\2016-fluent-logo-design-digital-marketing-20nine-4.png" width="540" height="158" alt="img1"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--/100% body table-->
</body>
</html>
I have also tried with only passing image path to the imgsrc in html but that is also not working.
Please let me know what I'm missing in here.
Also, is there any such package like FluentEmail which can provide such all facility with ASP.NET Core 2.0?
You have to use a LinkedResource; have a look at this
using (LinkedResource image = new LinkedResource(#"c:\assets\image.jpg", "image/jpeg") { ContentId = "myimage" })
using (MailMessage mail = new MailMessage())
using (SmtpClient smtpClient = new SmtpClient())
{
smtpClient.Host = "smtp.alfki.com";
String body = #"
<html>
<head></head>
<body>
<img src=""cid:myimage"" />
</body>
</html>
";
AlternateView view = AlternateView.CreateAlternateViewFromString(body, null, "text/html");
view.LinkedResources.Add(image);
mail.IsBodyHtml = true;
mail.AlternateViews.Add(view);
mail.From = new MailAddress("John.Doe#alfki.com");
mail.To.Add("Jane.Doe#alfki.com");
mail.Subject = "An email with an inline image";
smtpClient.Send(mail);
}
Edit:
It works in .NET Core/Standard.
I can not speak for FluentMail; maybe you can do without?

Magento - How to change font-size for totals in order email?

After upgrading from 1.8 to 1.9.1 the font-size of my order emails is changed for the block totals and I can't figure out how to change it.
At the moment it looks like this: http://www.pic-upload.de/view-26791263/Unbenannt.jpg.html
I would like to change the font-sie to 12px like the rest of the email text.
Here my template from the backend:
<h1></h1>
<style type="text/css">
<!--
.Stil1 {
font-size: 12px;
font-weight: bold;
}
.Stil2 {font-size: 12px}
.Stil4 {font-size: 10px}
-->
</style>
<body style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<footer style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<!-- [ header starts here] -->
<tr>
<td valign="top" bgcolor="#FFFFFF"><div align="right">
<p><img src="{{skin url="images/logo.jpg" _area='frontend'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/>
</p>
<p>Shop Name <span class="Stil4">Shop Adress </span></p>
</div></td>
</tr>
<!-- [ middle starts here] -->
<tr>
<td valign="top" bgcolor="#FFFFFF">
<h1 class="Stil2" style="font-size:12px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Sehr geehrte Kundin, sehr geehrter Kunde, </h1>
<p class="Stil2">Vielen Dank für Ihre Bestellung. <br>
Die Bearbeitung Ihrer Bestellung sollte innerhalb der nächsten 5-7 Tage erfolgen. Sollten Sie dann nicht von uns hören, oder keine Ware erhalten, möchten wir Sie bitten, sich mit uns in Verbindung zu setzen. </p>
<span class="Stil2">Vielen Dank, <br>
Ihr Team </span>
<p style="font-size:12px; line-height:16px; margin:0;"> </p>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<h2 style="font-size:18px; font-weight:normal; margin:0;"><span class="Stil1">Ihre Bestellung #{{var order.increment_id}} <small>(getätigt am {{var order.getCreatedAtFormated('long')}})</small></span></h2> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2"> Rechnungsadresse:</span></th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Zahlart:</span></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; border-top:1px solid #EAEAEA;">
{{var order.getBillingAddress().format('html')}} <br>
{{htmlescape var=$order.getCustomerEmail()}} </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; border-top:1px solid #EAEAEA;">
{{var payment_html}}{{var order.customer_taxvat}} </td>
</tr>
</tbody>
</table>
<br/>
{{depend order.getIsNotVirtual()}}
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Lieferadresse:</span></th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Porto:</span></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; border-top:1px solid #EAEAEA;">
{{var order.getShippingAddress().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; border-top:1px solid #EAEAEA;">Shipping Fees </td>
</tr>
</tbody>
</table>
<br/>
{{/depend}}
{{layout handle="sales_email_order_items" order=$order}} <br>
<span class="Stil2">Bestellkommentar:</span>
<p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
and template style:
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
this worked well before but now the size of the totals block is much bigger. Can anyone suggest me where to add the correct tag to edit the font-size?
Try adding styles to the following template:
/app/design/frontend/**base/default**/template/sales/order/totals.phtml
or check the same file to your custom theme.
Try setting the font size on your local.xml. eg:
<sales_email_order_items>
<reference name="order_totals">
<action method="setLabelProperties"><value>style="padding:6px 9px;font-size:12px;"</value></action>
<action method="setValueProperties"><value>style="padding:6px 9px;font-size:12px;"</value></action>
</reference>
</sales_email_order_items>