PHP Интерфейс Webiny\Component\Mailer\MessageInterface

The object itself is provided by the Mailer bridge.
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
__invoke ( ) : mixed
addAttachment ( File $file, string $fileName = '', string $type = 'plain/text' ) Attach a file to your message.
addBcc ( Email $email ) Appends one more address to the blind-copied list.
addCc ( Email $email ) Appends one more address to the copied list.
addHeader ( string $name, string $value, null | array $params = null ) Adds a header to the message.
addTo ( Email $email ) Appends one more recipient to the list.
getBcc ( ) : array Returns a list of defined bcc recipients.
getBody ( ) : string Returns the body of the message.
getCc ( ) : array Returns a list of addresses to whom the message will be copied to.
getContentTransferEncoding ( ) : string Get the defined encoding scheme.
getContentType ( ) : string Returns the defined content type of the message.
getFrom ( ) : Email Returns the person who sent the message.
getHeader ( string $name ) : mixed Get a header from the message.
getHeaders ( ) : array Get all headers from the message.
getReplyTo ( ) : Email Returns the reply-to address.
getReturnPath ( ) : string Returns the defined return-path.
getSender ( ) : Email Return the person who sent the message.
getSubject ( ) : string Get the current message subject.
getTo ( ) : array Returns a list of defined recipients.
setBcc ( array | Email $bcc ) Specifies the addresses of recipients who the message will be blind-copied to.
setBody ( string $content, string $type = 'text/html', string $charset = 'utf-8' ) : Webiny\Component\Mailer\MessageInterface Set the message body.
setCc ( array | Email $cc ) Specifies the addresses of recipients who will be copied in on the message.
setContentTransferEncoding ( string $encoding ) Specifies the encoding scheme in the message.
setContentType ( string $contentType ) Specifies the format of the message (usually text/plain or text/html).
setFrom ( Email $from ) Specifies the address of the person who the message is from.
setHeaders ( array | ArrayObject $headers ) Set multiple headers
setReplyTo ( Email $replyTo ) Define the reply-to address.
setReturnPath ( string $returnPath ) Defines the return path for the email.
setSender ( Email $sender ) Specifies the address of the person who physically sent the message.
setSubject ( string $subject ) Set the message subject.
setTo ( array | Email $to ) Specifies the emails of the intended recipients.

Описание методов

__invoke() публичный Метод

public __invoke ( ) : mixed
Результат mixed Message formatted for the mailer being implemented Example: array for Mandrill, \Swift_Message for SwiftMailer, etc.

addAttachment() публичный Метод

Attach a file to your message.
public addAttachment ( File $file, string $fileName = '', string $type = 'plain/text' )
$file Webiny\Component\Storage\File\File File instance
$fileName string Optional name that will be set for the attachment.
$type string Optional MIME type of the attachment

addBcc() публичный Метод

Appends one more address to the blind-copied list.
public addBcc ( Email $email )
$email Email

addCc() публичный Метод

Appends one more address to the copied list.
public addCc ( Email $email )
$email Email

addHeader() публичный Метод

Adds a header to the message.
public addHeader ( string $name, string $value, null | array $params = null )
$name string Header name.
$value string Header value.
$params null | array Optional array of parameters.

addTo() публичный Метод

Appends one more recipient to the list.
public addTo ( Email $email )
$email Email

getBcc() публичный Метод

Returns a list of defined bcc recipients.
public getBcc ( ) : array
Результат array

getBody() публичный Метод

Returns the body of the message.
public getBody ( ) : string
Результат string

getCc() публичный Метод

Returns a list of addresses to whom the message will be copied to.
public getCc ( ) : array
Результат array

getContentTransferEncoding() публичный Метод

Get the defined encoding scheme.
public getContentTransferEncoding ( ) : string
Результат string

getContentType() публичный Метод

Returns the defined content type of the message.
public getContentType ( ) : string
Результат string

getFrom() публичный Метод

Returns the person who sent the message.
public getFrom ( ) : Email
Результат Email

getHeader() публичный Метод

Get a header from the message.
public getHeader ( string $name ) : mixed
$name string Header name.
Результат mixed

getHeaders() публичный Метод

Get all headers from the message.
public getHeaders ( ) : array
Результат array

getReplyTo() публичный Метод

Returns the reply-to address.
public getReplyTo ( ) : Email
Результат Email

getReturnPath() публичный Метод

Returns the defined return-path.
public getReturnPath ( ) : string
Результат string

getSender() публичный Метод

Return the person who sent the message.
public getSender ( ) : Email
Результат Email

getSubject() публичный Метод

Get the current message subject.
public getSubject ( ) : string
Результат string Message subject.

getTo() публичный Метод

Returns a list of defined recipients.
public getTo ( ) : array
Результат array

setBcc() публичный Метод

Other recipients will not be aware of these copies.
public setBcc ( array | Email $bcc )
$bcc array | Email

setBody() публичный Метод

Set the message body.
public setBody ( string $content, string $type = 'text/html', string $charset = 'utf-8' ) : Webiny\Component\Mailer\MessageInterface
$content string The content of the body.
$type string Content type. Default 'text/html'.
$charset string Content body charset. Default 'utf-8'.
Результат Webiny\Component\Mailer\MessageInterface

setCc() публичный Метод

Specifies the addresses of recipients who will be copied in on the message.
public setCc ( array | Email $cc )
$cc array | Email

setContentTransferEncoding() публичный Метод

Specifies the encoding scheme in the message.
public setContentTransferEncoding ( string $encoding )
$encoding string

setContentType() публичный Метод

Specifies the format of the message (usually text/plain or text/html).
public setContentType ( string $contentType )
$contentType string

setFrom() публичный Метод

Can be multiple persons/addresses.
public setFrom ( Email $from )
$from Email

setHeaders() публичный Метод

Set multiple headers
public setHeaders ( array | ArrayObject $headers )
$headers array | Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject

setReplyTo() публичный Метод

Define the reply-to address.
public setReplyTo ( Email $replyTo )
$replyTo Email

setReturnPath() публичный Метод

By default it should be set to the sender.
public setReturnPath ( string $returnPath )
$returnPath string

setSender() публичный Метод

Higher precedence than "from".
public setSender ( Email $sender )
$sender Email

setSubject() публичный Метод

Set the message subject.
public setSubject ( string $subject )
$subject string Message subject.

setTo() публичный Метод

Specifies the emails of the intended recipients.
public setTo ( array | Email $to )
$to array | Email A list of recipients (instances of Email).