This helper is used with a module or extension to send emails that use EE templates. This supports PHP, globals, and entries loops.
Developed by eecoder.
-
To get started drop the file in a helpers directory in your module or extension.
$this->EE->load->library('template_mailer'); $email = new Template_mailer(); $email->to($this->EE->config->item('webmaster_email')); $email->from($this->EE->config->item('webmaster_email')); $email->subject('Subject'); $email->set(array( 'email_address' => '[email protected]', )); $result = $email->send('_messages/email-template');
$email->set()
creates variables for use in the email template, and are prepended with email:
. The variable above would be {email:email_address}