static void EmailTemplateReport(Args _args)
{
Map map = new Map(Types::String, Types::String);
str email;
SysEmailMessageTable message;
str messageBody;
SalesTable st = SalesTable::find("SO-00002778");
map.insert('Order.SalesId',st.SalesId);
map.insert('Order.ReturnReasonCodeId',st.ReturnReasonCodeId);
map.insert('Brand.BrandName',OCSBrandTable::find(st.OSSBrandId).BrandName);
map.insert('Order.CustAccount',st.CustAccount);
message = SysEmailMessageTable::find("RefundChk", "en-us");
if (message.LayoutType == SysEmailLayoutType::StaticLayout)
messageBody = message.Mail;
else
messageBody = SysEmailBatch::doTransform("", message.xsltMail);
messageBody = SysLabel::resolveLabels(messageBody, 'en-us');
messageBody = SysEmailMessage::stringExpand(messageBody, SysEmailTable::htmlEncodeParameters(map));
messageBody = Web::stripHTML(messageBody);
}
=================================================================
static void email(Args _args)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
str filePathName;
SalesTable _lastSalesOrder = SalesTable::find("SO-00005921");
OWIStoreTable OWIStoreTable;
notes bodymsg, bodymsg1;
str strsplit;
ListIterator iterator;
List strlist=new List(Types::String);
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
select OWIStoreTable
where OWIStoreTable.BrandId == _lastSalesOrder.OSSBrandId;
//filePathName = "C:\\Users\\back\\Desktop"+ "ach.txt";
mailer.fromAddress('NoReply.JohnsonSmith@JSLS1.com');
mailer.tos().appendAddress('back@columbusglobal.com;tama@columbusglobal.com');
// mailer.tos().appendAddress(OWIStoreTable.SystemTestEmail);
//mailer.htmlBody('AZZZ');
mailer.subject('Email test AX_webstore');
strlist =strSplit(OWIStoreTable.EmailNotesWebstore,"\n");
iterator = new ListIterator(strlist);
while(iterator.more())
{
/*if(!strsplit)
strsplit = iterator.value();
else
{
strsplit = strsplit + '\n' + iterator.value();
}*/
//mailer.htmlBody(strFmt("<br>%1<br>",iterator.value()));
bodymsg += strFmt("%1<br>",iterator.value());
iterator.next();
}
//mailer.htmlBody(strsplit);
bodymsg = strReplace(bodymsg,'\n','<br>');
// bodymsg = bodymsg + '\n' + strFmt(" %1", OWIStoreTable.EmailNotesWebstore) + "\n";
bodymsg =bodymsg + "\n" + strFmt("last order received for this webtore : %1", _lastSalesOrder.createdDateTime);
bodymsg1= strFmtLB(bodymsg);
/*
mailer.htmlBody(strFmt(" %1", OWIStoreTable.EmailNotesWebstore));
mailer.htmlBody(strFmt(" %1", OWIStoreTable.SystemTestEmail));
mailer.htmlBody(strFmt("last order received for this webtore : %1", _lastSalesOrder.createdDateTime));*/
mailer.htmlBody(bodymsg1);
mailer.sendMail();
}
=====================================================================
static void EmailTemplateSendEmail(Args _args)
{
Map map = new Map(Types::String, Types::String);
str email;
SalesTable st = SalesTable::find("SO-00002778");
map.insert('Order.SalesId',st.SalesId);
map.insert('Order.ReturnReasonCodeId',st.ReturnReasonCodeId);
map.insert('Brand.BrandName',OCSBrandTable::find(st.OSSBrandId).BrandName);
map.insert('Order.CustAccount',st.CustAccount);
email = Web::stripHTML(SysEmailMessageTable::find(
OCSBrandTemplates::findBrandTemplate(st.OSSBrandId,st.OSSOrderProfileId, fieldNum(OCSBrandTemplates, RefundTemplate)).RefundTemplate, 'en-us').Mail);
SysEmailTable::sendMail("RefundChk","en-us",'back@columbusglobal.com',map,'','',true);
//info(strFmt("%1",map));
}
==================================================================
static void emailThruSysMailer(Args _args)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
mailer.fromAddress(SysUserInfo::find().Email);
mailer.tos().appendAddress('PKB@Columbusglobal.com');
mailer.htmlBody('AZZZ');
mailer.subject('Comunicazione AX');
mailer.sendMail();
}
{
Map map = new Map(Types::String, Types::String);
str email;
SysEmailMessageTable message;
str messageBody;
SalesTable st = SalesTable::find("SO-00002778");
map.insert('Order.SalesId',st.SalesId);
map.insert('Order.ReturnReasonCodeId',st.ReturnReasonCodeId);
map.insert('Brand.BrandName',OCSBrandTable::find(st.OSSBrandId).BrandName);
map.insert('Order.CustAccount',st.CustAccount);
message = SysEmailMessageTable::find("RefundChk", "en-us");
if (message.LayoutType == SysEmailLayoutType::StaticLayout)
messageBody = message.Mail;
else
messageBody = SysEmailBatch::doTransform("", message.xsltMail);
messageBody = SysLabel::resolveLabels(messageBody, 'en-us');
messageBody = SysEmailMessage::stringExpand(messageBody, SysEmailTable::htmlEncodeParameters(map));
messageBody = Web::stripHTML(messageBody);
}
=================================================================
static void email(Args _args)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
str filePathName;
SalesTable _lastSalesOrder = SalesTable::find("SO-00005921");
OWIStoreTable OWIStoreTable;
notes bodymsg, bodymsg1;
str strsplit;
ListIterator iterator;
List strlist=new List(Types::String);
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
select OWIStoreTable
where OWIStoreTable.BrandId == _lastSalesOrder.OSSBrandId;
//filePathName = "C:\\Users\\back\\Desktop"+ "ach.txt";
mailer.fromAddress('NoReply.JohnsonSmith@JSLS1.com');
mailer.tos().appendAddress('back@columbusglobal.com;tama@columbusglobal.com');
// mailer.tos().appendAddress(OWIStoreTable.SystemTestEmail);
//mailer.htmlBody('AZZZ');
mailer.subject('Email test AX_webstore');
strlist =strSplit(OWIStoreTable.EmailNotesWebstore,"\n");
iterator = new ListIterator(strlist);
while(iterator.more())
{
/*if(!strsplit)
strsplit = iterator.value();
else
{
strsplit = strsplit + '\n' + iterator.value();
}*/
//mailer.htmlBody(strFmt("<br>%1<br>",iterator.value()));
bodymsg += strFmt("%1<br>",iterator.value());
iterator.next();
}
//mailer.htmlBody(strsplit);
bodymsg = strReplace(bodymsg,'\n','<br>');
// bodymsg = bodymsg + '\n' + strFmt(" %1", OWIStoreTable.EmailNotesWebstore) + "\n";
bodymsg =bodymsg + "\n" + strFmt("last order received for this webtore : %1", _lastSalesOrder.createdDateTime);
bodymsg1= strFmtLB(bodymsg);
/*
mailer.htmlBody(strFmt(" %1", OWIStoreTable.EmailNotesWebstore));
mailer.htmlBody(strFmt(" %1", OWIStoreTable.SystemTestEmail));
mailer.htmlBody(strFmt("last order received for this webtore : %1", _lastSalesOrder.createdDateTime));*/
mailer.htmlBody(bodymsg1);
mailer.sendMail();
}
=====================================================================
static void EmailTemplateSendEmail(Args _args)
{
Map map = new Map(Types::String, Types::String);
str email;
SalesTable st = SalesTable::find("SO-00002778");
map.insert('Order.SalesId',st.SalesId);
map.insert('Order.ReturnReasonCodeId',st.ReturnReasonCodeId);
map.insert('Brand.BrandName',OCSBrandTable::find(st.OSSBrandId).BrandName);
map.insert('Order.CustAccount',st.CustAccount);
email = Web::stripHTML(SysEmailMessageTable::find(
OCSBrandTemplates::findBrandTemplate(st.OSSBrandId,st.OSSOrderProfileId, fieldNum(OCSBrandTemplates, RefundTemplate)).RefundTemplate, 'en-us').Mail);
SysEmailTable::sendMail("RefundChk","en-us",'back@columbusglobal.com',map,'','',true);
//info(strFmt("%1",map));
}
==================================================================
static void emailThruSysMailer(Args _args)
{
SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
mailer.fromAddress(SysUserInfo::find().Email);
mailer.tos().appendAddress('PKB@Columbusglobal.com');
mailer.htmlBody('AZZZ');
mailer.subject('Comunicazione AX');
mailer.sendMail();
}
No comments:
Post a Comment