PHP Class Common\Mailer\Message

Inheritance: extends Swift_Message
Mostrar archivo Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( string $subject = null, string $body = null, string $contentType = null, string $charset = null ) Create a new Message.
addAttachments ( array $attachments ) : Message Attach multiple attachments to this message
newInstance ( string $subject = null, string $body = null, string $contentType = null, string $charset = null ) : Message Create a new Message.
parseHtml ( string $template, array $variables, boolean $addUTM = false ) : Message Parses a TwigTemplate with the wanted variables
setPlainText ( string $content ) : Message Add plaintext content as fallback for the html

Private Methods

Method Description
addUTM ( string $html, string $subject ) : string
cssToInlineStyles ( string $html ) : string Converts all css to inline styles
getTemplateContent ( string $template, array $variables = null ) : string Returns the content from a given template
relativeToAbsolute ( string $html ) : string Replace internal links and images to absolute links

Method Details

__construct() public method

Details may be optionally passed into the constructor.
public __construct ( string $subject = null, string $body = null, string $contentType = null, string $charset = null )
$subject string
$body string
$contentType string
$charset string

addAttachments() public method

Attach multiple attachments to this message
public addAttachments ( array $attachments ) : Message
$attachments array
return Message

newInstance() public static method

Create a new Message.
public static newInstance ( string $subject = null, string $body = null, string $contentType = null, string $charset = null ) : Message
$subject string
$body string
$contentType string
$charset string
return Message

parseHtml() public method

Parses a TwigTemplate with the wanted variables
public parseHtml ( string $template, array $variables, boolean $addUTM = false ) : Message
$template string
$variables array
$addUTM boolean
return Message

setPlainText() public method

Add plaintext content as fallback for the html
public setPlainText ( string $content ) : Message
$content string
return Message