Hi, can anyone help me figure out how configure in Marketing Cloud to change logo colors for emails in dark mode ? We have a rule that the logo needs to be all white when in black background, but we cannot figure out how to make it happen automatically when e-mail is in Dark Mode. We tried to make the background white for the logo, but it is not visually great... Thank you!
I would like to change the default subject of shipping confirmation email shown below.
"Shipping Confirmation of your Order & #XX;YYYYYYYYYYYYYYYYYYYYYYY"
I added <title></title> between <head></head> on order/orderemailshippingconfirmation.isml in bm extension cartridge, but didn't work.
Does anyone know how to do it?
Sep 12, 2023, 1:17 PM You can use EmailModel.js approach in your server code,
function sendEmail (options) {
var Mail = require('dw/net/Mail');
if (!options.template || !options.recipient || !options.subject) {
return;
}
var mail = new Mail();
mail.addTo(options.recipient);
mail.setSubject(options.subject);
mail.setFrom(options.from || Site.getCurrent().getCustomPreferenceValue('customerServiceEmail') || 'no-reply@salesforce.com');
var context = require('~/cartridge/scripts/object').toHashMap(options.context);
context.CurrentForms = session.forms;
context.CurrentHttpParameterMap = request.httpParameterMap;
context.CurrentCustomer = customer;
var template = new Template(options.template);
var content = template.render(context).text;
mail.setContent(content, 'text/html', 'UTF-8');
return mail.send();
};
And in your email template you should add subject part like in the orderconfirmation.isml
<iscontent type="text/html " charset="UTF-8"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<iscomment>The "subject" tag contains the mail subject and can contain dynamic information, like the order number.</iscomment>
<subject><isif condition="${!empty(pdict.MailSubject)}">${pdict.MailSubject}<iselse/><isprint value="${Resource.msg('order.orderconfirmation-email.001','order',null)}" encoding="off"/> <isprint value="${pdict.Order.orderNo}"/></isif></subject>
<iscomment>
The "to" tag contains the email address of the recipient, the "from" tag the email address of the sender.
Each tag is to be specified max. once. Multiple email address can be separated by "," (see RFC2822).
</iscomment>
<to>${pdict.Order.customerEmail}</to>
<from>${dw.system.Site.getCurrent().getCustomPreferenceValue('customerServiceEmail')}</from>
<head>
<isinclude template="util/modules"/>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="background:#e0e0e0;padding:50px 0;">
<center>
<table style="background:#ffffff;border:1px solid #999999;width:680px;">
<tr>
<td style="font-size:12px;font-family:arial;padding:20px 10px;vertical-align:top;">
<a href="${URLUtils.httpHome()}" title="${Resource.msg('global.storename','locale',null)}">
<img src="${URLUtils.httpStatic('/images/logo.gif')}" alt="${Resource.msg('global.storename','locale',null)}" style="border:none;"/>
</a>
</td>
<td style="font-size:12px;font-family:arial;padding:20px 10px;vertical-align:top;">
<strong>${Resource.msg('global.storename','locale',null)}</strong><br />
${Resource.msg('order.orderconfirmation-email.storeaddress','order',null)}<br />
${Resource.msg('order.orderconfirmation-email.storelocation','order',null)}<br />
<a href="${URLUtils.httpHome()}" title="${Resource.msg('order.orderconfirmation-email.jumptostore','order',null)}">${Resource.msg('global.storenameurl','locale',null)}</a><br />
${Resource.msg('order.orderconfirmation-email.storephone','order',null)}
</td>
</tr>
<tr>
<td colspan="2" style="font-size:12px;font-family:arial;padding:20px 10px;vertical-align:top;">
<table style="background:#ffffff;border:1px solid #999999;width:680px;">
<tr>
<th style="background:#cccccc;padding:5px 20px;font-size:12px;font-family:arial;text-align:left;">${Resource.msg('confirmation.thankyou','checkout',null)}</th>
</tr>
<tr>
<td style="font-size:12px;font-family:arial;padding:20px 10px;vertical-align:top;">
<p>${Resource.msg('confirmation.message','checkout',null)}</p>
<p>${Resource.msg('confirmation.contact','checkout',null)}</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="font-size:12px;font-family:arial;padding:20px 10px;vertical-align:top;" colspan="2">
<isemailorderdetails order="${pdict.Order}"/>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>