Skip to content

Latest commit

 

History

History
87 lines (73 loc) · 9.72 KB

documentation.md

File metadata and controls

87 lines (73 loc) · 9.72 KB

Table of contents


Class: \nickcv\mandrill\Mailer

Mailer is the class that consuming the Message object sends emails thorugh the Mandrill API.

Visibility Function
public compose(mixed/string/array/null $view=null, array $params=array()) : MessageInterface message instance.
Creates a new message instance and optionally composes its body content via view rendering. - a string, which represents the view name or path alias for rendering the HTML body of the email. In this case, the text body will be generated by applying strip_tags() to the HTML body. - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias for rendering the HTML body, while 'text' element is for rendering the text body. For example, ['html' => 'contact-html', 'text' => 'contact-text']. - null, meaning the message instance will be returned without body content. The view to be rendered can be specified in one of the following formats: - path alias (e.g. "@app/mail/contact"); - a relative view name (e.g. "contact") located under [[viewPath]].
public getLastTransaction() : array
Returns the array of the last transaction returned by Mandrill.
public getMandrill() : Mailchimp
Gets Mailchimp instance
public getMailchimp() : Mailchimp
Gets Mailchimp instance
public init() : void
Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration.
public setApikey(string $apikey) : void
Sets the API key for Mandrill
protected sendMessage(\nickcv\mandrill\Message $message) : boolean whether the message is sent successfully
Sends the specified message.

This class extends \yii\mail\BaseMailer

This class implements \yii\base\ViewContextInterface, \yii\mail\MailerInterface, \yii\base\Configurable


Class: \nickcv\mandrill\Message

Message is the class that is used to store the data of an email message that will be sent through Mandrill API.

Visibility Function
public areClicksTracked() : boolean
Returns the status of tracking for when the links in the message are clicked.
public areOpensTracked() : boolean
Returns the status of tracking for when the message is opened.
public attach(string $fileName, array $options=array()) : \nickcv\mandrill\Message
Attaches existing file to the email message.
public attachContent(string $content, array $options=array()) : \nickcv\mandrill\Message
Attach specified content as file for the email message.
public disableAsync() : \nickcv\mandrill\Message
Disables async sending the this message.
public disableClicksTracking() : \nickcv\mandrill\Message
Disable tracking of when links in the message are being clicked.
public disableOpensTracking() : \nickcv\mandrill\Message
Disable tracking of when the message is opened.
public disableTemplateDefaults() : \nickcv\mandrill\Message
Disable the use of template defaults.
public embed(string $fileName, array $options=array()) : \nickcv\mandrill\Message
Embeds an image in the email message.
public embedContent(string $content, array $options=array()) : \nickcv\mandrill\Message
Embed a binary as an image in the message.
public enableAsync() : \nickcv\mandrill\Message
Enables async sending for this message.
public enableClicksTracking() : \nickcv\mandrill\Message
Enable tracking of when links in the message are being clicked. Tracking is enabled by default.
public enableOpensTracking() : \nickcv\mandrill\Message
Enable tracking of when the message is opened. Tracking is enabled by default.
public enableTemplateDefaults() : \nickcv\mandrill\Message
Enable the use of template defaults.
public getAttachments() : array
Returns the attachments array.
public getBcc() : array
Returns an array of email addresses in the following format: ~~~ [
public getCc() : array
Returns an array of email addresses in the following format: ~~~ [
public getCharset() : null
Mandrill does not let users set a charset.
public getEmbeddedContent() : array list of embedded content
Returns the images array.
public getFrom() : string
Returns the from email address in this format: ~~~ Sender Name [email protected] ~~~ The default value for the sender name is the application name configuration parameter inside config/web.php. The default value for the sender address is the adminEmail parameter inside config/params.php.
public getGlobalMergeVars() : array
Returns the global merge vars that will be submitted to mandrill.
public getHtmlBody() : string
Returns the html purified version of the html body.
public getMandrillMessageArray() : array
Returns the array used by the Mandrill Class to initialize a message and submit it.
public getReplyTo() : array
Returns an array of email addresses in the following format: ~~~ [
public getSubaccount() : string
public getSubject() : string
Returns the html-encoded subject.
public getTags() : array the list of tags
Returns the list of tags you already set for this message.
public getTemplateContent() : array
Returns the dynamic content used to replace blocks in the template.
public getTemplateName() : string
Returns the name of the mandrill template to be used.
public getTextBody() : string
Returns the html-purified version of the raw text body.
public getTo() : array
Returns an array of email addresses in the following format: ~~~ [
public isAsync() : boolean
Tells whether or not the message will be sent asynchronously.
public isImportant() : boolean
public setAsImportant() : \nickcv\mandrill\Message
Make the message important.
public setAsNotImportant() : \nickcv\mandrill\Message
Make the message not important. The message is not important by default.
public setBcc(string/array $bcc) : \nickcv\mandrill\Message
Sets the message recipient(s).
public setCc(string/array $cc) : \nickcv\mandrill\Message
Sets the message recipient(s).
public setCharset(string $charset) : \nickcv\mandrill\Message
Mandrill does not let users set a charset.
public setFrom(string/array $from) : \nickcv\mandrill\Message
Sets the message sender.
public setGlobalMergeVars(array $mergeVars) : \nickcv\mandrill\Message
_Adds the given merge vars to the global merge vars array. Merge vars are case insensitive and cannot start with __
public setHtmlBody(string $html) : \nickcv\mandrill\Message
Sets the html body.
public setReplyTo(string/array $replyTo) : \nickcv\mandrill\Message
Sets the message recipient(s).
public setSubaccount(string $subaccount) : \nickcv\mandrill\Message
public setSubject(string $subject) : \nickcv\mandrill\Message
Sets the message subject.
public setTags(string/array $tag) : \nickcv\mandrill\Message
Mandrill lets you use tags to categorize your messages, making it much easier to find the messages your are looking for within their website dashboard. Stats are accumulated within mandrill using tags, though they only store the first 100 they see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will be ignored. Some common tags include registration and password reset.
public setTemplateData(string $templateName, array $templateContent=array(), string $templateLanguage='mailchimp') : \nickcv\mandrill\Message
Sets the data to be used by the Mandrill template system.
public setTextBody(string $text) : \nickcv\mandrill\Message
Sets the raw text body.
public setTo(string/array $to) : \nickcv\mandrill\Message
Sets the message recipient(s).
public toString() : string
Returns the string representation of this message.

This class extends \yii\mail\BaseMessage

This class implements \yii\mail\MessageInterface, \yii\base\Configurable