Using SystemMail

$SystemMail is an instance of \App\EmailQueue. The purpose of this class is to enable user to send email. Email retention is forever and this may be useful in case there is a compliant requirement.

The simplest method to send an e-mail programmatically is to use this method:

$SystemMail->sendSimpleEmailToQueue(string $field_subject, string $field_from_name, string $field_from_email, string $field_to_name, string $field_to_email, string $body_html, string $body_text, $attachments=NULL)

The email will first be sent to the queue and processed later.

 Email Queue

 

To send and email with a pre-defined template, use the sendEmailWithTemplateName($field_from_name, $field_from_email, $field_to_name, $field_to_email, $field_cc_name, $field_cc_email, $field_replyto_name, $field_replyto_email, $virtual_filename, $vars) method, where the $virtual_filename is the email template name and $vars is an associative array containing key/value variable name.