Back to MailTemplate class

Method __construct

public
__construct
(mixed $templateId, mixed $language, \Joomla\CMS\Mail\Mail $mailer = null)
Constructor for the mail templating class
Parameters
  • string $templateId Id of the mail template.
  • string $language Language of the template to use.
  • \Joomla\CMS\Mail\Mail $mailer Mail object to send the mail with.
Since
  • 4.0.0
Class: MailTemplate
Project: Joomla

Method __construct - Source code

/**
 * Constructor for the mail templating class
 *
 * @param   string  $templateId  Id of the mail template.
 * @param   string  $language    Language of the template to use.
 * @param   Mail    $mailer      Mail object to send the mail with.
 *
 * @since   4.0.0
 */
public function __construct($templateId, $language, Mail $mailer = null)
{
    $this->template_id = $templateId;
    $this->language = $language;
    if ($mailer) {
        $this->mailer = $mailer;
    } else {
        $this->mailer = Factory::getMailer();
    }
}