class Emails \ Email



Method Summary

Name Description
compile($template_id, $arguments = array())
phpmailer($to, $to_name, $subject, $message, $html_message = false) TODO support HTML emails
registerGlobalArgument($name, $callback) This allows clients to add global variables to all emails sent.
send($to_or_user, $template_id, $arguments = array()) Send an email with the given template to the given user or address. The subject of the e-mail is obtained from the first line of the text e-mail template, or the of the HTML template. </td> </tr> <tr> <td><a href="class_Emails_Email.html#setMockMailer" class="">setMockMailer($mock)</a></td> <td> </td> </tr> </tbody> </table> <hr> <h3> <small>static function</small> compile($template_id, $arguments = array()) <a name="compile"></a> </h3> <blockquote> <dl> <dt>Defaults:</dt> <dd> <div> <code>arguments</code> = array() </div> </dd> </dl> </blockquote> <hr> <h3> <small>static function</small> phpmailer($to, $to_name, $subject, $message, $html_message = false) <a name="phpmailer"></a> </h3> <blockquote> <p> TODO support HTML emails </p> <dl> <dt>Defaults:</dt> <dd> <div> <code>html_message</code> = <code>false</code> </div> </dd> <dt>Returns:</dt> <dd> <div> the sent message ID </div> </dd> <dt>Throws:</dt> <dd> <div> <a href="class_Emails_MailerException.html" class="">MailerException</a> - if the mail could not be immediately sent </div> </dd> </dl> </blockquote> <hr> <h3> <small>static function</small> registerGlobalArgument($name, $callback) <a name="registerGlobalArgument"></a> </h3> <blockquote> <p> This allows clients to add global variables to all emails sent. </p> <dl> <dt>Parameters:</dt> <dd> <div> <code>$callback</code> - callback function that returns an argument value, given the original $arguments as the first parameter </div> </dd> </dl> </blockquote> <hr> <h3> <small>static function</small> send($to_or_user, $template_id, $arguments = array()) <a name="send"></a> </h3> <blockquote> <p> Send an email with the given template to the given user or address. The subject of the e-mail is obtained from the first line of the text e-mail template, or the <title> of the HTML template. </p> <p> TODO support mock mailing TODO support i18n TODO service wrapper to allow emails to be queued </p> <dl> <dt>Parameters:</dt> <dd> <div> <code>$to_or_user</code> - either an email address, or something with getEmail() and optionally getName() </div> </dd> <dt>Defaults:</dt> <dd> <div> <code>arguments</code> = array() </div> </dd> <dt>Returns:</dt> <dd> <div> the email result object, which is also sent to the <code>email_sent</code> event trigger </div> </dd> <dt>Throws:</dt> <dd> <div> <a href="class_Emails_MailerException.html" class="">MailerException</a> - if the mail could not be immediately sent (e.g. technical error, invalid e-mail address...) </div> </dd> </dl> </blockquote> <hr> <h3> <small>static function</small> setMockMailer($mock) <a name="setMockMailer"></a> </h3> <blockquote> <dl> <dt>Parameters:</dt> <dd> <div> <code>$mock</code> - a callback with arguments ($to_email, $to_name, $subject, $template, $html_template), or <code>null</code> to remove the mock mailer </div> </dd> </dl> </blockquote> </div><div class="footer"> Generated by <a class="github" href="https://github.com/soundasleep/phpdoc2/">PHPDoc2</a> Wed, 06 May 2015 15:59:41 +1200</div> </body></html>