Documentation

SendGridMail
in package

Table of Contents

Properties

$use_headers  : mixed
$attachment_list  : mixed
$bcc_list  : mixed
$cc_list  : mixed
$from  : mixed
$from_name  : mixed
$header_list  : mixed
$html  : mixed
$reply_to  : mixed
$subject  : mixed
$text  : mixed
$to_list  : mixed

Methods

__construct()  : mixed
addAttachment()  : SendGridMail
addAttachment Add a new email attachment, given the file name.
addBcc()  : SendGridMail
addBcc Append an email address to the list of Blind Carbon Copy recipients
addCategory()  : SendGridMail
addCategory Append a category to the list of categories
addCc()  : SendGridMail
addCc Append an address to the list of Carbon Copy recipients
addFilterSetting()  : SendGridMail
addFilterSetting Append a filter setting to the list of filter settings
addHeader()  : SendGridMail
addHeaders append the header to the list of headers
addSection()  : SendGridMail
addSection append a section value to the list of section values
addSubstitution()  : SendGridMail
addSubstitution Substitute a value for list of values, where each value corresponds to the list emails in a one to one relationship. (IE, value[0] = email[0], value[1] = email[1])
addTo()  : SendGridMail
addTo append an email address to the existing list of addresses Preserve previous recipient 'to' data.
addUniqueArgument()  : SendGridMail
addUniqueArgument Set a key/value pair of unique arguments, to be used for tracking purposes
getAttachments()  : array<string|int, mixed>
getAttachments Get the list of file attachments
getBccs()  : array<string|int, mixed>
getBccs return the list of Blind Carbon Copy recipients
getCcs()  : array<string|int, mixed>
getCc get the Carbon Copy list of recipients
getFrom()  : the
getFrom get the from email address
getFromName()  : the
getFromName get the from name
getHeaders()  : array<string|int, mixed>
getHeaders return the list of headers
getHeadersJson()  : array<string|int, mixed>
getHeaders return the list of headers
getHtml()  : SendGridMail
getHtml Get the HTML part of the email
getReplyTo()  : the
getReplyTo get the reply-to address
getSubject()  : the
getSubject get the email subject
getText()  : the
getText get the plain text part of the email
getTos()  : array<int, mixed>
getTos Return the list of recipients
removeAttachment()  : SendGridMail
removeAttachment Remove a previously added file attachment, given the file name.
removeBcc()  : SendGridMail
removeBcc remove an email address from the list of Blind Carbon Copy addresses
removeCategory()  : SendGridMail
removeCategory Given a category name, remove that category from the list of category headers
removeCc()  : SendGridMail
removeCc remove an address from the list of Carbon Copy recipients
removeHeader()  : SendGridMail
removeHeaders remove a header key
removeTo()  : SendGridMail
removeTo remove an email address from the list of recipient addresses
setAttachment()  : SendGridMail
setAttachment Initialize the list of attachments, and add the given file destroys previous attachment data.
setAttachments()  : SendGridMail
setAttachments add multiple file attachments at once destroys previous attachment data.
setBcc()  : SendGridMail
setBcc Initialize the list of Carbon Copy recipients destroy previous recipient Blind Carbon Copy data
setBccs()  : SendGridMail
setBccs set the list of Blind Carbon Copy Recipients
setCategories()  : SendGridMail
setCategories Set the list of category headers destroys previous category header data
setCategory()  : SendGridMail
setCategory Clears the category list and adds the given category
setCc()  : SendGridMail
setCc Initialize the list of Carbon Copy recipients destroy previous recipient data
setCcs()  : SendGridMail
setCcs Set the list of Carbon Copy recipients
setFilterSettings()  : SendGridMail
setFilterSettings Set filter/app settings
setFrom()  : SendGridMail
setFrom set the from email
setFromName()  : SendGridMail
setFromName set the name appended to the from email
setHeaders()  : SendGridMail
setHeaders Sets the list headers destroys previous header data
setHtml()  : SendGridMail
setHTML Set the HTML part of the email
setRecipientsInHeader()  : mixed
setReplyTo()  : SendGridMail
setReplyTo set the reply-to address
setSections()  : SendGridMail
setSection Set a list of section values
setSubject()  : SendGridMail
setSubject set the email subject
setSubstitutions()  : SendGridMail
SetSubstitutions
setText()  : SendGridMail
setText Set the plain text part of the email
setTo()  : SendGridMail
setTo Initialize a single email for the recipient 'to' field Destroy previous recipient 'to' data.
setTos()  : SendGridMail
setTos Initialize an array for the recipient 'to' field Destroy previous recipient 'to' data.
setUniqueArguments()  : SendGridMail
setUniqueArguments Set a list of unique arguments, to be used for tracking purposes
useHeaders()  : mixed
useHeaders Checks to see whether or not we can or should you headers. In most cases, we prefer to send our recipients through the headers, but in some cases, we actually don't want to. However, there are certain circumstances in which we have to.
_isHeadersRequired()  : bool
isHeaderRequired determines whether or not we need to force recipients through the smtpapi headers
_preferNotToUseHeaders()  : bool
_preferNotToUseHeaders There are certain cases in which headers are not a preferred choice to send email, as it limits some basic email functionality. Here, we check for any of those rules, and add them in to decide whether or not to use headers
_getAttachmentInfo()  : array<string|int, mixed>
get file details
_removeFromList()  : mixed
_removeFromList Given a list of key/value pairs, removes the associated keys where a value matches the given string ($item)

Properties

$use_headers

protected mixed $use_headers

$attachment_list

private mixed $attachment_list

$bcc_list

private mixed $bcc_list

$cc_list

private mixed $cc_list

$from_name

private mixed $from_name

$header_list

private mixed $header_list = array()

$reply_to

private mixed $reply_to

$subject

private mixed $subject

$to_list

private mixed $to_list

Methods

__construct()

public __construct() : mixed

addAttachment()

addAttachment Add a new email attachment, given the file name.

public addAttachment(string $file) : SendGridMail
Parameters
$file : string

The file to attach.

Return values
SendGridMail

the SendGrid\Mail object.

addBcc()

addBcc Append an email address to the list of Blind Carbon Copy recipients

public addBcc(string $email) : SendGridMail
Parameters
$email : string

an email address

Return values
SendGridMail

the SendGrid\Mail object.

addCategory()

addCategory Append a category to the list of categories

public addCategory(string $category) : SendGridMail
Parameters
$category : string

the new category to append

Return values
SendGridMail

the SendGrid\Mail object.

addCc()

addCc Append an address to the list of Carbon Copy recipients

public addCc(string $email) : SendGridMail
Parameters
$email : string

an email address

Return values
SendGridMail

the SendGrid\Mail object.

addFilterSetting()

addFilterSetting Append a filter setting to the list of filter settings

public addFilterSetting(string $filter_name, string $parameter_name, string $parameter_value) : SendGridMail
Parameters
$filter_name : string
  • filter name
$parameter_name : string
  • parameter name
$parameter_value : string
  • setting value
Return values
SendGridMail

the SendGrid\Mail object.

addHeader()

addHeaders append the header to the list of headers

public addHeader(string $key, string $value) : SendGridMail
Parameters
$key : string

the header key

$value : string

the header value

Return values
SendGridMail

the SendGrid\Mail object.

addSection()

addSection append a section value to the list of section values

public addSection(string $from_value, string $to_value) : SendGridMail
Parameters
$from_value : string

the value to be replaced

$to_value : string

the value to replace

Return values
SendGridMail

the SendGrid\Mail object.

addSubstitution()

addSubstitution Substitute a value for list of values, where each value corresponds to the list emails in a one to one relationship. (IE, value[0] = email[0], value[1] = email[1])

public addSubstitution(mixed $from_value, array<string|int, mixed> $to_values) : SendGridMail
Parameters
$from_value : mixed
$to_values : array<string|int, mixed>

an array of values to replace the $from_value

Return values
SendGridMail

the SendGrid\Mail object.

addTo()

addTo append an email address to the existing list of addresses Preserve previous recipient 'to' data.

public addTo(string $email[, mixed $name = null ]) : SendGridMail
Parameters
$email : string

a single email address

$name : mixed = null
Return values
SendGridMail

the SendGrid\Mail object.

addUniqueArgument()

addUniqueArgument Set a key/value pair of unique arguments, to be used for tracking purposes

public addUniqueArgument(string $key, string $value) : SendGridMail
Parameters
$key : string

key

$value : string

value

Return values
SendGridMail

the SendGrid\Mail object.

getAttachments()

getAttachments Get the list of file attachments

public getAttachments() : array<string|int, mixed>
Return values
array<string|int, mixed>

of indexed file attachments

getBccs()

getBccs return the list of Blind Carbon Copy recipients

public getBccs() : array<string|int, mixed>
Return values
array<string|int, mixed>
  • the list of Blind Carbon Copy recipients

getCcs()

getCc get the Carbon Copy list of recipients

public getCcs() : array<string|int, mixed>
Return values
array<string|int, mixed>

the list of recipients

getFrom()

getFrom get the from email address

public getFrom([bool $as_array = false ]) : the
Parameters
$as_array : bool = false

return the from as an assocative array

Return values
the

from email address

getFromName()

getFromName get the from name

public getFromName() : the
Return values
the

from name

getHeaders()

getHeaders return the list of headers

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

the list of headers

getHeadersJson()

getHeaders return the list of headers

public getHeadersJson() : array<string|int, mixed>
Return values
array<string|int, mixed>

the list of headers

getReplyTo()

getReplyTo get the reply-to address

public getReplyTo() : the
Return values
the

reply to address

getSubject()

getSubject get the email subject

public getSubject() : the
Return values
the

email subject

getText()

getText get the plain text part of the email

public getText() : the
Return values
the

plain text part of the email

getTos()

getTos Return the list of recipients

public getTos() : array<int, mixed>
Return values
array<int, mixed>

of recipients

removeAttachment()

removeAttachment Remove a previously added file attachment, given the file name.

public removeAttachment(string $file) : SendGridMail
Parameters
$file : string

the file attachment to remove.

Return values
SendGridMail

the SendGrid\Mail object.

removeBcc()

removeBcc remove an email address from the list of Blind Carbon Copy addresses

public removeBcc(string $email) : SendGridMail
Parameters
$email : string

the email to remove

Return values
SendGridMail

the SendGrid\Mail object.

removeCategory()

removeCategory Given a category name, remove that category from the list of category headers

public removeCategory(string $category) : SendGridMail
Parameters
$category : string

the category to be removed

Return values
SendGridMail

the SendGrid\Mail object.

removeCc()

removeCc remove an address from the list of Carbon Copy recipients

public removeCc(string $email) : SendGridMail
Parameters
$email : string

an email address

Return values
SendGridMail

the SendGrid\Mail object.

removeHeader()

removeHeaders remove a header key

public removeHeader(string $key) : SendGridMail
Parameters
$key : string
  • the key to remove
Return values
SendGridMail

the SendGrid\Mail object.

removeTo()

removeTo remove an email address from the list of recipient addresses

public removeTo(string $search_term) : SendGridMail
Parameters
$search_term : string

the regex value to be removed

Return values
SendGridMail

the SendGrid\Mail object.

setAttachment()

setAttachment Initialize the list of attachments, and add the given file destroys previous attachment data.

public setAttachment(string $file) : SendGridMail
Parameters
$file : string

the file to attach

Return values
SendGridMail

the SendGrid\Mail object.

setAttachments()

setAttachments add multiple file attachments at once destroys previous attachment data.

public setAttachments(array<string|int, mixed> $files) : SendGridMail
Parameters
$files : array<string|int, mixed>

The list of files to attach

Return values
SendGridMail

the SendGrid\Mail object.

setBcc()

setBcc Initialize the list of Carbon Copy recipients destroy previous recipient Blind Carbon Copy data

public setBcc(string $email) : SendGridMail
Parameters
$email : string

an email address

Return values
SendGridMail

the SendGrid\Mail object.

setBccs()

setBccs set the list of Blind Carbon Copy Recipients

public setBccs(array<string|int, mixed> $email_list) : SendGridMail
Parameters
$email_list : array<string|int, mixed>

the list of email recipients to

Return values
SendGridMail

the SendGrid\Mail object.

setCategories()

setCategories Set the list of category headers destroys previous category header data

public setCategories(array<string|int, mixed> $category_list) : SendGridMail
Parameters
$category_list : array<string|int, mixed>

the list of category values

Return values
SendGridMail

the SendGrid\Mail object.

setCategory()

setCategory Clears the category list and adds the given category

public setCategory(string $category) : SendGridMail
Parameters
$category : string

the new category to append

Return values
SendGridMail

the SendGrid\Mail object.

setCc()

setCc Initialize the list of Carbon Copy recipients destroy previous recipient data

public setCc(string $email) : SendGridMail
Parameters
$email : string

a list of email addresses

Return values
SendGridMail

the SendGrid\Mail object.

setCcs()

setCcs Set the list of Carbon Copy recipients

public setCcs(array<string|int, mixed> $email_list) : SendGridMail
Parameters
$email_list : array<string|int, mixed>
Return values
SendGridMail

the SendGrid\Mail object.

setFilterSettings()

setFilterSettings Set filter/app settings

public setFilterSettings(array<string|int, mixed> $filter_settings) : SendGridMail
Parameters
$filter_settings : array<string|int, mixed>

array of fiter settings

Return values
SendGridMail

the SendGrid\Mail object.

setFrom()

setFrom set the from email

public setFrom(string $email) : SendGridMail
Parameters
$email : string

an email address

Return values
SendGridMail

the SendGrid\Mail object.

setFromName()

setFromName set the name appended to the from email

public setFromName(string $name) : SendGridMail
Parameters
$name : string

a name to append

Return values
SendGridMail

the SendGrid\Mail object.

setHeaders()

setHeaders Sets the list headers destroys previous header data

public setHeaders(array<string|int, mixed> $key_value_pairs) : SendGridMail
Parameters
$key_value_pairs : array<string|int, mixed>
  • the list of header data
Return values
SendGridMail

the SendGrid\Mail object.

setHtml()

setHTML Set the HTML part of the email

public setHtml(string $html) : SendGridMail
Parameters
$html : string

the HTML part of the email

Return values
SendGridMail

the SendGrid\Mail object.

setRecipientsInHeader()

public setRecipientsInHeader(mixed $preference) : mixed
Parameters
$preference : mixed

setReplyTo()

setReplyTo set the reply-to address

public setReplyTo(string $email) : SendGridMail
Parameters
$email : string

the email to reply to

Return values
SendGridMail

the SendGrid\Mail object.

setSections()

setSection Set a list of section values

public setSections(array<string|int, mixed> $key_value_pairs) : SendGridMail
Parameters
$key_value_pairs : array<string|int, mixed>
Return values
SendGridMail

the SendGrid\Mail object.

setSubject()

setSubject set the email subject

public setSubject(string $subject) : SendGridMail
Parameters
$subject : string

the email subject

Return values
SendGridMail

the SendGrid\Mail object.

setSubstitutions()

SetSubstitutions

public setSubstitutions(array<string|int, mixed> $key_value_pairs) : SendGridMail

Substitute a value for list of values, where each value corresponds to the list emails in a one to one relationship. (IE, value[0] = email[0], value[1] = email[1])

Parameters
$key_value_pairs : array<string|int, mixed>

key/value pairs where the value is an array of values

Return values
SendGridMail

the SendGrid\Mail object.

setText()

setText Set the plain text part of the email

public setText(string $text) : SendGridMail
Parameters
$text : string

the plain text of the email

Return values
SendGridMail

the SendGrid\Mail object.

setTo()

setTo Initialize a single email for the recipient 'to' field Destroy previous recipient 'to' data.

public setTo(string $email) : SendGridMail
Parameters
$email : string

a list of email addresses

Return values
SendGridMail

the SendGrid\Mail object.

setTos()

setTos Initialize an array for the recipient 'to' field Destroy previous recipient 'to' data.

public setTos(array<string|int, mixed> $email_list) : SendGridMail
Parameters
$email_list : array<string|int, mixed>

an array of email addresses

Return values
SendGridMail

the SendGrid\Mail object.

setUniqueArguments()

setUniqueArguments Set a list of unique arguments, to be used for tracking purposes

public setUniqueArguments(array<string|int, mixed> $key_value_pairs) : SendGridMail
Parameters
$key_value_pairs : array<string|int, mixed>

list of unique arguments

Return values
SendGridMail

the SendGrid\Mail object.

useHeaders()

useHeaders Checks to see whether or not we can or should you headers. In most cases, we prefer to send our recipients through the headers, but in some cases, we actually don't want to. However, there are certain circumstances in which we have to.

public useHeaders() : mixed

_isHeadersRequired()

isHeaderRequired determines whether or not we need to force recipients through the smtpapi headers

protected _isHeadersRequired() : bool
Return values
bool

if true headers are required

_preferNotToUseHeaders()

_preferNotToUseHeaders There are certain cases in which headers are not a preferred choice to send email, as it limits some basic email functionality. Here, we check for any of those rules, and add them in to decide whether or not to use headers

protected _preferNotToUseHeaders() : bool
Return values
bool

if true we don't

_getAttachmentInfo()

get file details

private _getAttachmentInfo(mixed $file) : array<string|int, mixed>
Parameters
$file : mixed
Return values
array<string|int, mixed>

with file details

_removeFromList()

_removeFromList Given a list of key/value pairs, removes the associated keys where a value matches the given string ($item)

private _removeFromList(array<string|int, mixed> &$list, string $item[, mixed $key_field = null ]) : mixed
Parameters
$list : array<string|int, mixed>
  • the list of key/value pairs
$item : string
  • the value to be removed
$key_field : mixed = null

        
On this page

Search results