PHP 클래스 Webiny\Component\Mailer\Mailer

This class provides access to mail Transport and mail Message object. Use the getMessage to create an email message, and then use the send method to send it using the Transport object.
상속: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\ComponentTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $mailer = 'Default' ) Base constructor.
getMessage ( array | ArrayObject | ConfigObject $config = null ) : Webiny\Component\Mailer\MessageInterface Creates a new message.
getTransport ( ) : Webiny\Component\Mailer\TransportInterface Returns the current transport instance.
send ( Webiny\Component\Mailer\MessageInterface $message, null | array &$failures = null ) : boolean | integer Sends the message.
setDecorators ( array $replacements ) Decorators are arrays that contain keys and values. The message body and subject will be scanned for the keys, and, where found, the key will be replaced with the value.

메소드 상세

__construct() 공개 메소드

Base constructor.
public __construct ( string $mailer = 'Default' )
$mailer string Key of the mailer configuration.

getMessage() 공개 메소드

Creates a new message.
public getMessage ( array | ArrayObject | ConfigObject $config = null ) : Webiny\Component\Mailer\MessageInterface
$config array | Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject | Webiny\Component\Config\ConfigObject (Optional)
리턴 Webiny\Component\Mailer\MessageInterface

getTransport() 공개 메소드

Returns the current transport instance.
public getTransport ( ) : Webiny\Component\Mailer\TransportInterface
리턴 Webiny\Component\Mailer\TransportInterface

send() 공개 메소드

Sends the message.
public send ( Webiny\Component\Mailer\MessageInterface $message, null | array &$failures = null ) : boolean | integer
$message Webiny\Component\Mailer\MessageInterface Message you want to send.
$failures null | array To this array failed addresses will be stored.
리턴 boolean | integer Number of success sends, or bool FALSE if sending failed.

setDecorators() 공개 메소드

Decorators are arrays that contain keys and values. The message body and subject will be scanned for the keys, and, where found, the key will be replaced with the value.
public setDecorators ( array $replacements )
$replacements array Array [email=> [key1=>value1, key2=>value2], email2=>[...]].