Envelope
class Envelope (View source)
Traits
Properties
Address|string|null | $from | The address sending the message. |
|
array | $to | The recipients of the message. |
|
array | $cc | The recipients receiving a copy of the message. |
|
array | $bcc | The recipients receiving a blind copy of the message. |
|
array | $replyTo | The recipients that should be replied to. |
|
string|null | $subject | The subject of the message. |
|
array | $tags | The message's tags. |
|
array | $metadata | The message's meta data. |
|
array | $using | The message's Symfony Message customization callbacks. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Create a new message envelope instance.
Normalize the given array of addresses.
Specify who the message will be "from".
Add a "to" recipient to the message envelope.
Add a "cc" recipient to the message envelope.
Add a "bcc" recipient to the message envelope.
Add a "reply to" recipient to the message envelope.
Set the subject of the message.
Add "tags" to the message.
Add a "tag" to the message.
Add metadata to the message.
Determine if the message is from the given address.
Determine if the message has the given address as a recipient.
Determine if the message has the given address as a "cc" recipient.
Determine if the message has the given address as a "bcc" recipient.
Determine if the message has the given address as a "reply to" recipient.
Determine if the message has the given recipient.
Determine if the message has the given subject.
Determine if the message has the given metadata.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
void
__construct(Address|string|null $from = null, Address|string> $to = [], Address|string> $cc = [], Address|string> $bcc = [], Address|string> $replyTo = [], string|null $subject = null, array $tags = [], array $metadata = [], Closure|array $using = [])
Create a new message envelope instance.
protected Address>
normalizeAddresses(Address|string> $addresses)
Normalize the given array of addresses.
$this
from(Address|string $address, string|null $name = null)
Specify who the message will be "from".
$this
to(Address|array|string $address, string|null $name = null)
Add a "to" recipient to the message envelope.
$this
cc(Address|array|string $address, string|null $name = null)
Add a "cc" recipient to the message envelope.
$this
bcc(Address|array|string $address, string|null $name = null)
Add a "bcc" recipient to the message envelope.
$this
replyTo(Address|array|string $address, string|null $name = null)
Add a "reply to" recipient to the message envelope.
$this
subject(string $subject)
Set the subject of the message.
$this
tags(array $tags)
Add "tags" to the message.
$this
tag(string $tag)
Add a "tag" to the message.
$this
metadata(string $key, string|int $value)
Add metadata to the message.
$this
using(Closure $callback)
Add a Symfony Message customization callback to the message.
bool
isFrom(string $address, string|null $name = null)
Determine if the message is from the given address.
bool
hasTo(string $address, string|null $name = null)
Determine if the message has the given address as a recipient.
bool
hasCc(string $address, string|null $name = null)
Determine if the message has the given address as a "cc" recipient.
bool
hasBcc(string $address, string|null $name = null)
Determine if the message has the given address as a "bcc" recipient.
bool
hasReplyTo(string $address, string|null $name = null)
Determine if the message has the given address as a "reply to" recipient.
protected bool
hasRecipient(array $recipients, string $address, string|null $name = null)
Determine if the message has the given recipient.
bool
hasSubject(string $subject)
Determine if the message has the given subject.
bool
hasMetadata(string $key, string $value)
Determine if the message has the given metadata.