Email message.
More...
|
static | factory (array $options=[]) |
| Create an email instance form an array of options. More...
|
|
Email message.
Definition at line 13 of file Email.php.
◆ addAttachment()
Elgg\Email::addAttachment |
( |
|
$attachment | ) |
|
Add an attachment.
- Parameters
-
mixed | $attachment | \Laminas\Mime\Part or \Elgg\Email\Attachment or \ElggFile or an array |
- See also
- \Elgg\Email\Attachment::factory()
- Returns
- self
Definition at line 323 of file Email.php.
◆ addHeader()
Elgg\Email::addHeader |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Adds/replaces an HTTP/IMF header.
- Parameters
-
string | $name | Header name |
mixed | $value | Header value |
- Returns
- self
Definition at line 288 of file Email.php.
◆ createEntityMessageID()
Elgg\Email::createEntityMessageID |
( |
\ElggEntity |
$entity, |
|
|
bool |
$add_microtime = false |
|
) |
| |
Create a Message-ID header string for the given entity.
- Parameters
-
\ElggEntity | $entity | The entity to generate the header for |
bool | $add_microtime | Add a microtime to the header (used for non create events) |
- Returns
- string
- Since
- 4.2
Definition at line 361 of file Email.php.
◆ factory()
static Elgg\Email::factory |
( |
array |
$options = [] | ) |
|
|
static |
Create an email instance form an array of options.
- Parameters
-
array | $options | Options 'from' - ElggEntity, or email string, or \Elgg\Email\Address 'to' - ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types 'cc' - ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types 'bcc' - ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types 'subject' - subject string 'body' - body string 'params' - additional parameters 'headers' - HTTP/IMF headers |
- Returns
- \Elgg\Email
Definition at line 80 of file Email.php.
◆ getAttachments()
Elgg\Email::getAttachments |
( |
| ) |
|
Get all attachments.
- Returns
- \Laminas\Mime\Part[]
Definition at line 348 of file Email.php.
◆ getBcc()
Returns recipient address from bcc.
- Returns
- \Elgg\Email\Address[]
Definition at line 211 of file Email.php.
◆ getBody()
Returns email body.
- Returns
- string
Definition at line 255 of file Email.php.
◆ getCc()
Returns recipient address from cc.
- Returns
- \Elgg\Email\Address[]
Definition at line 190 of file Email.php.
◆ getFrom()
Returns sender address.
- Returns
- \Elgg\Email\Address
Definition at line 148 of file Email.php.
◆ getHeaders()
Elgg\Email::getHeaders |
( |
| ) |
|
Returns headers.
- Returns
- array
Definition at line 310 of file Email.php.
◆ getParams()
Elgg\Email::getParams |
( |
| ) |
|
Returns additional params.
- Returns
- array
Definition at line 276 of file Email.php.
◆ getSender()
Elgg\Email::getSender |
( |
| ) |
|
Returns sender.
- Returns
- mixed
Definition at line 127 of file Email.php.
◆ getSubject()
Elgg\Email::getSubject |
( |
| ) |
|
Returns the subject.
It is possible to limit the length of the subject string. This is sometimes needed for certain mail servers / clients.
- Returns
- string
Definition at line 234 of file Email.php.
◆ getTo()
Returns recipient address.
- Returns
- \Elgg\Email\Address[]
Definition at line 169 of file Email.php.
◆ prepareFrom()
static Elgg\Email::prepareFrom |
( |
|
$from | ) |
|
|
staticprotected |
Converts mixed input to an instance of Laminas addres.
- Parameters
-
- Returns
- Address
- Exceptions
-
Definition at line 382 of file Email.php.
◆ prepareRecipients()
Elgg\Email::prepareRecipients |
( |
|
$recipients | ) |
|
|
protected |
Converts mixed input to an array of Laminas address instances.
- Parameters
-
mixed | $recipients | recipients input |
- Returns
- Address[]
- Exceptions
-
Definition at line 420 of file Email.php.
◆ setBcc()
Elgg\Email::setBcc |
( |
|
$recipient | ) |
|
Sets recipient address in bcc.
- Parameters
-
mixed | $recipient | ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types |
- Returns
- self
Definition at line 201 of file Email.php.
◆ setBody()
Elgg\Email::setBody |
( |
|
$body = '' | ) |
|
Sets the email message body.
- Parameters
-
- Returns
- self
Definition at line 245 of file Email.php.
◆ setCc()
Elgg\Email::setCc |
( |
|
$recipient | ) |
|
Sets recipient address in cc.
- Parameters
-
mixed | $recipient | ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types |
- Returns
- self
Definition at line 180 of file Email.php.
◆ setFrom()
Elgg\Email::setFrom |
( |
Address |
$from | ) |
|
Sets sender address.
- Parameters
-
\Elgg\Email\Address | $from | Sender address |
- Returns
- self
Definition at line 138 of file Email.php.
◆ setHeaders()
Elgg\Email::setHeaders |
( |
array |
$headers = [] | ) |
|
Replaces header bag.
- Parameters
-
- Returns
- self
Definition at line 300 of file Email.php.
◆ setParams()
Elgg\Email::setParams |
( |
array |
$params = [] | ) |
|
Sets additional params.
- Parameters
-
- Returns
- self
Definition at line 266 of file Email.php.
◆ setSender()
Elgg\Email::setSender |
( |
|
$sender | ) |
|
Sets email sender.
- Parameters
-
mixed | $sender | Original sender of the Email |
- Returns
- self
Definition at line 117 of file Email.php.
◆ setSubject()
Elgg\Email::setSubject |
( |
|
$subject = '' | ) |
|
Sets email subject.
- Parameters
-
- Returns
- self
Definition at line 222 of file Email.php.
◆ setTo()
Elgg\Email::setTo |
( |
|
$recipient | ) |
|
Sets recipient address.
- Parameters
-
mixed | $recipient | ElggEntity, or email string, or \Elgg\Email\Address, or an array of one of these types |
- Returns
- self
Definition at line 159 of file Email.php.
◆ $attachments
Elgg\Email::$attachments = [] |
|
protected |
◆ $bcc
◆ $body
◆ $cc
◆ $from
◆ $headers
Elgg\Email::$headers = [] |
|
protected |
◆ $params
◆ $sender
◆ $subject
◆ $to
The documentation for this class was generated from the following file: