Posts

Showing posts from August, 2023

Send E-mail using SysMailer class

 * Send simple paragrapgh or message using Email Template static void ProjectAssignmentEmailUsingSysMalier(Args _args) {     SysEmailParameters      parameters;     SMTPRelayServerName     relayServer;     SMTPPortNumber          portNumber;     Str1260                 subject, body;     SysMailer               mailer;     System.Exception        e;     SysEmailTable           sysEmailTable;     SysEmailMessageTable    message;     HcmWorker               worker;     ProjTable               projTable;     SysEmailId              sysEmailId;     Map...

Send E-mail using SysEmailTable::sendEmail() method

 * Send simple paragrapgh or message using Email Template  * SysEmailTable is a table and sendMail() is a method static void ProjectAssignmentEmailUsingSysEmailTable(Args _args) {     SysEmailId sysEmailId;     Map mappings;     str recepient;     HcmWorker worker;     ProjTable projTable;     worker = HcmWorker::find(5637183005);     projTable = projTable::find('6805');     sysEmailId = 'Custom';     if (worker && projTable)     {             recepient = worker.email();             mappings = new Map(Types::String,Types::String);             mappings.insert('WorkerName', worker.name()); // this will replace variable with actual value.             mappings.insert('ProjectId', projTable.ProjId);             mappings.insert('...

Send email using .Net framework

Image
This code will send email using .Net Framework. Create email template:      Goto : Organization adminstration > Setup > E-mail templates. Create E-mail template give E-mail ID, E-mail description, Default language, Sender name, Sender e-mail. set the email body of above-created record. Goto: E-mail message and set e-mail body as below. static void SendEmployeesDataInEmail(Args _args) {     System.Net.Mail.MailMessage    mailMessage;     System.Net.Mail.SmtpClient     smtpClient;     SystemParameters               systemParameters;     Email                          emailFrom, emailTo;     SysEmailMessageTable           message;     SysEmailId                     sysEmailId;     Employee...

Send email using HTML

static void SendEmailUsingHTML(Args _args) {     System.Text.StringBuilder   htmlTable;     SysEmailParameters          parameters = SysEmailParameters::find();     SMTPRelayServerName         relayServer;     SMTPPortNumber              portNumber;     Str1260                     subject, body;     SysMailer                   mailer;     System.Exception            e;     boolean                     recExsits = false;     EmployeeTable               employeeTable;     htmlTable   = new System.Text.StringBuilder();     htmlTable.Append("<style>...