Envelope
class Envelope
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 metadata. |
|
| 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.
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 subject.
Determine if the message has the given metadata.
Determine if the message has the given recipient.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
at line 71
__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 = [], array|Closure $using = [])
Create a new message envelope instance.
at line 90
protected array
normalizeAddresses(array $addresses)
Normalize the given array of addresses.
at line 102
Envelope
from(Address|string $address, string|null $name = null)
Specify who the message will be "from".
at line 114
Envelope
to(Address|array|string $address, string|null $name = null)
Add a "to" recipient to the message envelope.
at line 128
Envelope
cc(Address|array|string $address, string|null $name = null)
Add a "cc" recipient to the message envelope.
at line 142
Envelope
bcc(Address|array|string $address, string|null $name = null)
Add a "bcc" recipient to the message envelope.
at line 156
Envelope
replyTo(Address|array|string $address, string|null $name = null)
Add a "reply to" recipient to the message envelope.
at line 170
Envelope
subject(string $subject)
Set the subject of the message.
at line 182
Envelope
tags(array $tags)
Add "tags" to the message.
at line 194
Envelope
tag(string $tag)
Add a "tag" to the message.
at line 206
Envelope
metadata(string $key, int|string $value)
Add metadata to the message.
at line 218
Envelope
using(Closure $callback)
Add a Symfony Message customization callback to the message.
at line 228
bool
isFrom(string $address, string|null $name = null)
Determine if the message is from the given address.
at line 241
bool
hasTo(string $address, string|null $name = null)
Determine if the message has the given address as a recipient.
at line 249
bool
hasCc(string $address, string|null $name = null)
Determine if the message has the given address as a "cc" recipient.
at line 257
bool
hasBcc(string $address, string|null $name = null)
Determine if the message has the given address as a "bcc" recipient.
at line 265
bool
hasReplyTo(string $address, string|null $name = null)
Determine if the message has the given address as a "reply to" recipient.
at line 273
bool
hasSubject(string $subject)
Determine if the message has the given subject.
at line 281
bool
hasMetadata(string $key, int|string $value)
Determine if the message has the given metadata.
at line 289
protected bool
hasRecipient(array $recipients, string $address, string|null $name = null)
Determine if the message has the given recipient.