Methods summary
public
|
#
__construct( array $data )
Construct a new Email object.
Construct a new Email object.
Parameters
- $data
- Dependencies and settings.
|
protected
Charcoal\Email\Email
|
#
setTemplateFactory( Charcoal\Factory\FactoryInterface $factory )
Parameters
- $factory
- The factory to use to create email template objects.
Returns
|
protected
Charcoal\Factory\FactoryInterface
|
|
protected
Charcoal\Email\Email
|
#
setQueueItemFactory( Charcoal\Factory\FactoryInterface $factory )
Parameters
- $factory
- The factory to use to create email queue item objects.
Returns
|
protected
Charcoal\Factory\FactoryInterface
|
|
protected
Charcoal\Email\Email
|
#
setLogFactory( Charcoal\Factory\FactoryInterface $factory )
Parameters
- $factory
- The factory to use to create log objects.
Returns
|
protected
Charcoal\Factory\FactoryInterface
|
#
logFactory( )
Returns
Charcoal\Factory\FactoryInterface
|
public
Charcoal\Email\Email
|
#
setData( array $data )
Set the email's data.
Parameters
Returns
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setCampaign( string $campaign )
Set the campaign ID.
Parameters
- $campaign
- The campaign identifier.
Returns
Throws
InvalidArgumentException If the campaign is invalid.
Implementation of
|
public
string
|
#
campaign( )
Get the campaign identifier.
Get the campaign identifier.
If it has not been explicitely set, it will be auto-generated (with uniqid).
Returns
string
Implementation of
|
protected
string
|
#
generateCampaign( )
Generates a unique identifier ideal for a campaign ID.
Generates a unique identifier ideal for a campaign ID.
Returns
string
|
public
Charcoal\Email\EmailInterface
|
#
setTo( string|array $email )
Set the recipient email address(es).
Set the recipient email address(es).
Parameters
- $email
- The recipient email address(es).
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
addTo( mixed $email )
Add a recipient email address.
Add a recipient email address.
Parameters
- $email
- The recipient email address to add.
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
string[]
|
#
to( )
Get the recipient's email address.
Get the recipient's email address.
Returns
string[]
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setCc( string|array $email )
Set the carbon copy (CC) recipient email address(es).
Set the carbon copy (CC) recipient email address(es).
Parameters
- $email
- The CC recipient email address(es).
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
addCc( mixed $email )
Add a CC recipient email address.
Add a CC recipient email address.
Parameters
- $email
- The CC recipient email address to add.
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
string[]
|
#
cc( )
Get the CC recipient's email address.
Get the CC recipient's email address.
Returns
string[]
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setBcc( string|array $email )
Set the blind carbon copy (BCC) recipient email address(es).
Set the blind carbon copy (BCC) recipient email address(es).
Parameters
- $email
- The BCC recipient email address(es).
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
addBcc( mixed $email )
Add a BCC recipient email address.
Add a BCC recipient email address.
Parameters
- $email
- The BCC recipient email address to add.
Returns
Throws
InvalidArgumentException If the email address is invalid.
Implementation of
|
public
string[]
|
#
bcc( )
Get the BCC recipient's email address.
Get the BCC recipient's email address.
Returns
string[]
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setFrom( string|array $email )
Set the sender's email address.
Set the sender's email address.
Parameters
Returns
Throws
InvalidArgumentException If the email is not a string or an array.
Implementation of
|
public
string
|
#
from( )
Get the sender's email address.
Get the sender's email address.
Returns
string
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setReplyTo( mixed $email )
Set email address to reply to the message.
Set email address to reply to the message.
Parameters
- $email
- The sender's "Reply-To" email address.
Returns
Throws
InvalidArgumentException If the email is not a string or an array.
Implementation of
|
public
string
|
#
replyTo( )
Get email address to reply to the message.
Get email address to reply to the message.
Returns
string
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setSubject( string $subject )
Set the email subject.
Parameters
- $subject
- The email subject.
Returns
Throws
InvalidArgumentException If the subject is not a string.
Implementation of
|
public
string
|
#
subject( )
Get the email subject.
Returns
string The emails' subject.
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setMsgHtml( string $body )
Set the email's HTML message body.
Set the email's HTML message body.
Parameters
- $body
- The HTML message body.
Returns
Throws
InvalidArgumentException If the message is not a string.
Implementation of
|
public
string
|
#
msgHtml( )
Get the email's HTML message body.
Get the email's HTML message body.
If the message is not explitely set, it will be
auto-generated from a template view.
Returns
string
Implementation of
|
protected
string
|
#
generateMsgHtml( )
Get the email's HTML message from the template, if applicable.
Get the email's HTML message from the template, if applicable.
Returns
string
See
ViewableInterface::renderTemplate()
|
public
Charcoal\Email\EmailInterface
|
#
setMsgTxt( string $body )
Set the email's plain-text message body.
Set the email's plain-text message body.
Parameters
- $body
- The message's text body.
Returns
Throws
InvalidArgumentException If the parameter is invalid.
Implementation of
|
public
string
|
#
msgTxt( )
Get the email's plain-text message body.
Get the email's plain-text message body.
If the plain-text message is not explitely set,
it will be auto-generated from the HTML message.
Returns
string
Implementation of
|
protected
string
|
#
stripHtml( string $html )
Convert an HTML string to plain-text.
Convert an HTML string to plain-text.
Parameters
- $html
- The HTML string to convert.
Returns
string The resulting plain-text string.
|
public
Charcoal\Email\EmailInterface
|
#
setAttachments( array $attachments )
Set the email's attachments.
Set the email's attachments.
Parameters
- $attachments
- The file attachments.
Returns
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
addAttachment( mixed $attachment )
Add an attachment to the email.
Add an attachment to the email.
Parameters
- $attachment
- A single file attachment.
Returns
Implementation of
|
public
array
|
#
attachments( )
Get the email's attachments.
Get the email's attachments.
Returns
array
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setLog( boolean $log )
Enable or disable logging for this particular email.
Enable or disable logging for this particular email.
Parameters
Returns
Implementation of
|
public
boolean
|
#
log( )
Determine if logging is enabled for this particular email.
Determine if logging is enabled for this particular email.
Returns
boolean
Implementation of
|
public
Charcoal\Email\EmailInterface
|
#
setTrack( boolean $track )
Enable or disable tracking for this particular email.
Enable or disable tracking for this particular email.
Parameters
Returns
Implementation of
|
public
boolean
|
#
track( )
Determine if tracking is enabled for this particular email.
Determine if tracking is enabled for this particular email.
Returns
boolean
Implementation of
|
public
boolean
|
#
send( )
Send the email to all recipients
Send the email to all recipients
Returns
boolean Success / Failure.
Implementation of
|
public
|
#
setSmtpOptions( PHPMailer\PHPMailer\PHPMailer\PHPMailer\PHPMailer $mail )
Set the SMTP's options for PHPMailer.
Set the SMTP's options for PHPMailer.
Parameters
- $mail
- The PHPMailer to setup.
|
public
boolean
|
#
queue( mixed $ts = null )
Enqueue the email for each recipient.
Enqueue the email for each recipient.
Parameters
- $ts
- A date/time to initiate the queue processing.
Returns
boolean Success / Failure.
Implementation of
|
protected
|
#
logSend( boolean $result, mixed $mailer )
Log the send event for each recipient.
Log the send event for each recipient.
Parameters
- $result
- Success or failure.
- $mailer
- The raw mailer.
|
protected
|
|
public
Charcoal\Email\Email
|
#
setTemplateData( array $data )
Set the template data for the view.
Set the template data for the view.
Parameters
Returns
|
public
array
|
#
templateData( )
Get the template data for the view.
Get the template data for the view.
Returns
array
|
public
TemplateInterface|array
|
#
viewController( )
Get the custom view controller for rendering
the email's HTML message.
Get the custom view controller for rendering
the email's HTML message.
Unlike typical ViewableInterface objects, the view controller is not
the email itself but an external "email" template.
Returns
TemplateInterface|array
See
ViewableInterface::viewController()
|
protected
string
|
#
getter( string $key )
Allow an object to define how the key getter are called.
Allow an object to define how the key getter are called.
Parameters
- $key
- The key to get the getter from.
Returns
string The getter method name, for a given key.
|
protected
string
|
#
setter( string $key )
Allow an object to define how the key setter are called.
Allow an object to define how the key setter are called.
Parameters
- $key
- The key to get the setter from.
Returns
string The setter method name, for a given key.
|
public
Charcoal\Email\EmailConfig
|
#
createConfig( )
Temporary hack to fulfills the Configurable Interface.
Temporary hack to fulfills the Configurable Interface.
Returns
|