
This Post is in duplicated sorry. Here the right one
Hi all,
I am kinda new with batch processing and emails, so I would like you guys to give me a hand with this.
I have a code that calculates the prices of production against the sales orders. If the Productions costs > Sales order then pulls a trigger by code and send Email to specifics recipients.
I have configurated the basics stuff like email parameters and templates. And my code is actually sending the emails into the waiting stack ( ) . but only sends the actual email only if I pressed the ok button in the batch job. where Do I configure it in order to send emails directly after the trigger is pulled (just at the moment the code sends the email).
also How Do I sent to multiple recipients using the SysEmailSystemTable::sendMail()
here the code
static void AKS_NC_PreCalculate_Emails(Args _args)
{
SysEmailTable sysEmailTable;
SysEmailSystemTable sysEmailSysTable;
Map mappings = new Map(Types::String, Types::String);
List recipients;
// str xml;
;
// Build your variable/text mappings
mappings.insert('show_info', 'Here the Info body on the Mail ');
//sysEmailSysTable = sysEmailSysTable::find('ProdCost');
sysEmailSysTable =SysEmailSystemTable::find('ProdCost');
SysEmailSystemTable::sendMail(sysEmailSysTable.EmailId,
'en-gb', // Chosen language
"", // Who you're sending the email to
mappings, // Your variable mappings
'', // Location of file attachment (server/client matters) or none
'' , // XML if you're using XSLT
true, // Traceable or not?
'Nestor', // Sending user
true); // Use retries?
info("email Sent");
} you have to set recurrence on the batch job so it run periodically. also Email sending has its own batch job so check the recurrence of that batch job too.