Envelope
class Envelope (View source)
Traits
Conditionable |
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
$this|TWhenReturnType | when($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) truthy. | from Conditionable |
$this|TUnlessReturnType | unless($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) falsy. | from Conditionable |
void | __construct(Address|string $from = null, array $to = [], array $cc = [], array $bcc = [], array $replyTo = [], string $subject = null, array $tags = [], array $metadata = [], Closure|array $using = [])
Create a new message envelope instance. | |
array | normalizeAddresses(array $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 $name = null)
Determine if the message is from the given address. | |
bool | hasTo(string $address, string $name = null)
Determine if the message has the given address as a recipient. | |
bool | hasCc(string $address, string $name = null)
Determine if the message has the given address as a "cc" recipient. | |
bool | hasBcc(string $address, string $name = null)
Determine if the message has the given address as a "bcc" recipient. | |
bool | hasReplyTo(string $address, string $name = null)
Determine if the message has the given address as a "reply to" recipient. | |
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. |
Details
$this|TWhenReturnType when($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType unless($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
void __construct(Address|string $from = null, array $to = [], array $cc = [], array $bcc = [], array $replyTo = [], string $subject = null, array $tags = [], array $metadata = [], Closure|array $using = [])
Create a new message envelope instance.
protected array normalizeAddresses(array $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 $name = null)
Determine if the message is from the given address.
bool hasTo(string $address, string $name = null)
Determine if the message has the given address as a recipient.
bool hasCc(string $address, string $name = null)
Determine if the message has the given address as a "cc" recipient.
bool hasBcc(string $address, string $name = null)
Determine if the message has the given address as a "bcc" recipient.
bool hasReplyTo(string $address, string $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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/9.x/Illuminate/Mail/Mailables/Envelope.html