mail\BaseMailer compose()

compose() public method Creates a new message instance and optionally composes its body content via view rendering. public yii\mail\MessageInterface compose ( $view = null, array $params = [] )$view string|array|null The view to be used for rendering the message body. This can be: a string, which represents the view name or path alias for rendering the HTML body of the email. In this case, the text body will be generated by applying strip_tags() to the HTML body. an array with 'html' a

mail\BaseMailer beforeSend()

beforeSend() public method This method is invoked right before mail send. You may override this method to do last-minute preparation for the message. If you override this method, please make sure you call the parent implementation first. public boolean beforeSend ( $message )$message yii\mail\MessageInterface return boolean Whether to continue sending an email.

mail\BaseMailer afterSend()

afterSend() public method This method is invoked right after mail was send. You may override this method to do some postprocessing or logging based on mail send status. If you override this method, please make sure you call the parent implementation first. public void afterSend ( $message, $isSuccessful )$message yii\mail\MessageInterface $isSuccessful boolean

mail\BaseMailer $viewPath

$viewPath public property The directory that contains the view files for composing mail messages Defaults to '@app/mail'. public string getViewPath ( )public void setViewPath ( $path )

mail\BaseMailer $view

$view public property View instance or its array configuration that will be used to render message bodies. public yii\web\View getView ( )public void setView ( $view )

mail\BaseMailer $useFileTransport

$useFileTransport public property Whether to save email messages as files under $fileTransportPath instead of sending them to the actual recipients. This is usually used during development for debugging purpose. See also $fileTransportPath. public boolean $useFileTransport = false

mail\BaseMailer $textLayout

$textLayout public property Text layout view name. This is the layout used to render TEXT mail body. Please refer to $htmlLayout for possible values that this property can take. public string|boolean $textLayout = 'layouts/text'

mail\BaseMailer $messageConfig

$messageConfig public property The configuration that should be applied to any newly created email message instance by createMessage() or compose(). Any valid property defined by yii\mail\MessageInterface can be configured, such as from, to, subject, textBody, htmlBody, etc. For example: [ 'charset' => 'UTF-8', 'from' => 'noreply@mydomain.com', 'bcc' => 'developer@mydomain.com', ] public array $messageConfig = []

mail\BaseMailer $messageClass

$messageClass public property The default class name of the new message instances created by createMessage() public string $messageClass = 'yii\mail\BaseMessage'

mail\BaseMailer $htmlLayout

$htmlLayout public property HTML layout view name. This is the layout used to render HTML mail body. The property can take the following values: a relative view name: a view file relative to $viewPath, e.g., 'layouts/html'. a path alias: an absolute view file path specified as a path alias, e.g., '@app/mail/html'. a boolean false: the layout is disabled. public string|boolean $htmlLayout = 'layouts/html'