PHP Class Webiny\Component\Mailer\Bridge\SwiftMailer\Message

Inheritance: implements Webiny\Component\Mailer\Bridge\MessageInterface, use trait Webiny\Component\StdLib\StdLibTrait
Afficher le fichier Open project: Webiny/Framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ConfigObject $config = null )
__invoke ( )
addAttachment ( File $file, string $fileName = '', string $type = 'plain/text' ) Attach a file to your message.
addBcc ( Email $email )
addCc ( Email $email )
addFrom ( Email $email )
addHeader ( string $name, string $value, null | array $params = null ) Adds a header to the message.
addTo ( Email $email )
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.
getChildren ( )
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 ( $bcc )
setBody ( string $content, string $type = 'text/html', string $charset = 'utf-8' ) : Webiny\Component\Mailer\MessageInterface Set the message body.
setCc ( $cc )
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 )
setHeaders ( array | ArrayObject $headers ) Set multiple headers
setReplyTo ( Email $replyTo )
setReturnPath ( string $returnPath ) Defines the return path for the email.
setSender ( Email $sender )
setSubject ( string $subject ) Set the message subject.
setTo ( $to )

Method Details

__construct() public méthode

public __construct ( ConfigObject $config = null )
$config Webiny\Component\Config\ConfigObject

__invoke() public méthode

public __invoke ( )

addAttachment() public méthode

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() public méthode

public addBcc ( Email $email )
$email Webiny\Component\Mailer\Email

addCc() public méthode

public addCc ( Email $email )
$email Webiny\Component\Mailer\Email

addFrom() public méthode

public addFrom ( Email $email )
$email Webiny\Component\Mailer\Email

addHeader() public méthode

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() public méthode

public addTo ( Email $email )
$email Webiny\Component\Mailer\Email

getBcc() public méthode

Returns a list of defined bcc recipients.
public getBcc ( ) : array
Résultat array

getBody() public méthode

Returns the body of the message.
public getBody ( ) : string
Résultat string

getCc() public méthode

Returns a list of addresses to whom the message will be copied to.
public getCc ( ) : array
Résultat array

getChildren() public méthode

public getChildren ( )

getContentTransferEncoding() public méthode

Get the defined encoding scheme.
public getContentTransferEncoding ( ) : string
Résultat string

getContentType() public méthode

Returns the defined content type of the message.
public getContentType ( ) : string
Résultat string

getFrom() public méthode

Returns the person who sent the message.
public getFrom ( ) : Email
Résultat Webiny\Component\Mailer\Email

getHeader() public méthode

Get a header from the message.
public getHeader ( string $name ) : mixed
$name string Header name.
Résultat mixed

getHeaders() public méthode

Get all headers from the message.
public getHeaders ( ) : array
Résultat array

getReplyTo() public méthode

Returns the reply-to address.
public getReplyTo ( ) : Email
Résultat Webiny\Component\Mailer\Email

getReturnPath() public méthode

Returns the defined return-path.
public getReturnPath ( ) : string
Résultat string

getSender() public méthode

Return the person who sent the message.
public getSender ( ) : Email
Résultat Webiny\Component\Mailer\Email

getSubject() public méthode

Get the current message subject.
public getSubject ( ) : string
Résultat string Message subject.

getTo() public méthode

Returns a list of defined recipients.
public getTo ( ) : array
Résultat array

setBcc() public méthode

public setBcc ( $bcc )

setBody() public méthode

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'.
Résultat Webiny\Component\Mailer\MessageInterface

setCc() public méthode

public setCc ( $cc )

setContentTransferEncoding() public méthode

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

setContentType() public méthode

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

setFrom() public méthode

public setFrom ( Email $from )
$from Webiny\Component\Mailer\Email

setHeaders() public méthode

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

setReplyTo() public méthode

public setReplyTo ( Email $replyTo )
$replyTo Webiny\Component\Mailer\Email

setReturnPath() public méthode

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

setSender() public méthode

public setSender ( Email $sender )
$sender Webiny\Component\Mailer\Email

setSubject() public méthode

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

setTo() public méthode

public setTo ( $to )