MailerHelper

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\MailerHelper
Since
3.0

Class MailerHelper

View source

Public Methods

MethodDescription
allMailerTransportTypes()Returns all available mailer transport adapter classes.
createMailer()Creates a mailer component based on the given mail settings.
createTransportAdapter()Creates a transport adapter based on the given mail settings.

allMailerTransportTypes()

Returns all available mailer transport adapter classes.

View source

Returns

string[]

Signature

public static string[] allMailerTransportTypes ( )

createMailer()

Creates a mailer component based on the given mail settings.

View source

Arguments

Returns

craft\mail\Mailer

Signature

public static craft\mail\Mailer createMailer ( craft\models\MailSettings $settings )

createTransportAdapter()

Creates a transport adapter based on the given mail settings.

View source

Arguments

Returns

craft\mail\transportadapters\TransportAdapterInterface

Throws

Signature

public static craft\mail\transportadapters\TransportAdapterInterface createTransportAdapter ( \craft\helpers\string $type, array $settings = null )

Events

EVENT_REGISTER_MAILER_TRANSPORT_TYPES

Type
craft\events\RegisterComponentTypesEvent

The event that is triggered when registering mailer transport adapter types.

Mailer transports must implement craft\mail\transportadapters\TransportAdapterInterface. craft\mail\transportadapters\BaseTransportAdapter provides a base implementation.

Example