Elgg  Version 3.0
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Elgg\Email Class Reference

Email message. More...

Public Member Functions

 setFrom (Address $from)
 Sets sender address. More...
 
 getFrom ()
 Returns sender address. More...
 
 setTo (Address $to)
 Sets recipient address. More...
 
 getTo ()
 Returns recipient address. More...
 
 setSubject ($subject= '')
 Sets email subject. More...
 
 getSubject ()
 Returns the subject. More...
 
 setBody ($body= '')
 Sets the email message body. More...
 
 getBody ()
 Returns email body. More...
 
 setParams (array $params=[])
 Sets additional params. More...
 
 getParams ()
 Returns additional params. More...
 
 addHeader ($name, $value)
 Adds/replaces an HTTP/IMF header. More...
 
 setHeaders (array $headers=[])
 Replaces header bag. More...
 
 getHeaders ()
 Returns headers. More...
 
 addAttachment ($attachment)
 Add an attachment. More...
 
 getAttachments ()
 Get all attachments. More...
 

Static Public Member Functions

static factory (array $options=[])
 Create an email instance form an array of options. More...
 

Static Protected Member Functions

static prepareFrom ($from)
 Converts mixed input to an instance of Zend addres. More...
 
static prepareTo ($to)
 Converts mixed input to an instance of Zend addres. More...
 

Protected Attributes

 $from
 
 $to
 
 $subject
 
 $body
 
 $params = []
 
 $headers = []
 
 $attachments = []
 

Detailed Description

Email message.

Definition at line 15 of file Email.php.

Member Function Documentation

Elgg\Email::addAttachment (   $attachment)

Add an attachment.

Parameters
mixed$attachmentor or or an array
See also
::factory()
Returns
self

Definition at line 224 of file Email.php.

Elgg\Email::addHeader (   $name,
  $value 
)

Adds/replaces an HTTP/IMF header.

Parameters
string$nameHeader name
mixed$valueHeader value
Returns
self

Definition at line 191 of file Email.php.

static Elgg\Email::factory ( array  $options = [])
static

Create an email instance form an array of options.

Parameters
array$optionsOptions 'from' - ElggEntity, or email string, or 'to' - ElggEntity, or email string, or 'subject' - subject string 'body' - body string 'params' - additional parameters 'headers' - HTTP/IMF headers
Returns

Definition at line 64 of file Email.php.

Elgg\Email::getAttachments ( )

Get all attachments.

Returns
[]

Definition at line 249 of file Email.php.

Elgg\Email::getBody ( )

Returns email body.

Returns
string

Definition at line 161 of file Email.php.

Elgg\Email::getFrom ( )

Returns sender address.

Returns

Definition at line 104 of file Email.php.

Elgg\Email::getHeaders ( )

Returns headers.

Returns
array

Definition at line 211 of file Email.php.

Elgg\Email::getParams ( )

Returns additional params.

Returns
array

Definition at line 180 of file Email.php.

Elgg\Email::getSubject ( )

Returns the subject.

Returns
string

Definition at line 142 of file Email.php.

Elgg\Email::getTo ( )

Returns recipient address.

Returns

Definition at line 123 of file Email.php.

static Elgg\Email::prepareFrom (   $from)
staticprotected

Converts mixed input to an instance of Zend addres.

Parameters
mixed$fromFrom input
Returns
Address
Exceptions
InvalidParameterException

Definition at line 260 of file Email.php.

static Elgg\Email::prepareTo (   $to)
staticprotected

Converts mixed input to an instance of Zend addres.

Parameters
mixed$toTo input
Returns
Address
Exceptions
InvalidParameterException

Definition at line 292 of file Email.php.

Elgg\Email::setBody (   $body = '')

Sets the email message body.

Parameters
string$bodyBody
Returns
self

Definition at line 152 of file Email.php.

Elgg\Email::setFrom ( Address  $from)

Sets sender address.

Parameters
\Elgg\Email\Address$fromSender address
Returns
self

Definition at line 95 of file Email.php.

Elgg\Email::setHeaders ( array  $headers = [])

Replaces header bag.

Parameters
array$headersHeaders
Returns
self

Definition at line 202 of file Email.php.

Elgg\Email::setParams ( array  $params = [])

Sets additional params.

Parameters
array$paramsParams
Returns
self

Definition at line 171 of file Email.php.

Elgg\Email::setSubject (   $subject = '')

Sets email subject.

Parameters
string$subjectSubject
Returns
self

Definition at line 133 of file Email.php.

Elgg\Email::setTo ( Address  $to)

Sets recipient address.

Parameters
\Elgg\Email\Address$toRecipient address
Returns
self

Definition at line 114 of file Email.php.

Member Data Documentation

Elgg\Email::$attachments = []
protected

Definition at line 50 of file Email.php.

Elgg\Email::$body
protected

Definition at line 35 of file Email.php.

Elgg\Email::$from
protected

Definition at line 20 of file Email.php.

Elgg\Email::$headers = []
protected

Definition at line 45 of file Email.php.

Elgg\Email::$params = []
protected

Definition at line 40 of file Email.php.

Elgg\Email::$subject
protected

Definition at line 30 of file Email.php.

Elgg\Email::$to
protected

Definition at line 25 of file Email.php.


The documentation for this class was generated from the following file: