EmailHeader
in package
implements
OfcpEvent
The header of an email. Reused in all email events.
Table of Contents
Interfaces
- OfcpEvent
- Basic interface for OFCP-Events.
Properties
- $bcc : array<string|int, mixed>|null
- $cc : array<string|int, mixed>|null
- $replyTo : string|null
- $returnPath : string|null
- $subject : string
- $to : array<string|int, mixed>|null
Methods
- __construct() : self
- The header of an email. Reused in all email events.
- from_json() : self
- Parse JSON data into an instance of this class.
- getBcc() : array<string|int, mixed>|null
- getCc() : array<string|int, mixed>|null
- getReplyTo() : string|null
- getReturnPath() : string|null
- getSubject() : string
- getTo() : array<string|int, mixed>|null
- jsonSerialize() : array<string|int, mixed>
- setBcc() : void
- setCc() : void
- setReplyTo() : void
- setReturnPath() : void
- setSubject() : void
- setTo() : void
Properties
$bcc
private
array<string|int, mixed>|null
$bcc
$cc
private
array<string|int, mixed>|null
$cc
$replyTo
private
string|null
$replyTo
$returnPath
private
string|null
$returnPath
$subject
private
string
$subject
$to
private
array<string|int, mixed>|null
$to
Methods
__construct()
The header of an email. Reused in all email events.
public
__construct(string $subject, array<string|int, mixed> $bcc, array<string|int, mixed> $cc, string $replyTo, string $returnPath, array<string|int, mixed> $to) : self
Parameters
- $subject : string
-
The subject of the email.
- $bcc : array<string|int, mixed>
-
BCC stands for "blind carbon copy". Just like CC, BCC is a way of sending copies of an email to other people. The difference between the two is that no one can see the list of recipients in a BCC message. The BCC list is private.
- $cc : array<string|int, mixed>
-
CC stands for "carbon copy". Sends a copy of the email to the people you list, in addition to the person in the To field. Note that everyone who receives a copy of the message will be able to see the list of recipients in the CC field. In nearly all cases you should use the "bcc" field instead of the "cc" field.
- $replyTo : string
-
Set where replies to the email should be sent.
- $returnPath : string
-
A return path is used to specify where bounced emails are sent and is placed in the email header. It’s an SMTP address separate from the sending address. This is a good practice for email delivery, as it gives bounced emails a place to land – other than in an inbox – making it easier to avoid sending notifications to bounced addresses. However, it’s important for authentication to ensure that the return path domain is the same as the sending domain. Brands use a return path that stores all bounced emails, which helps them improve deliverability, making them more credible to inbox service providers (ISPs) like Gmail and Yahoo Mail. Return path also helps track email bounces and maintain email list hygiene.
- $to : array<string|int, mixed>
-
The email address of the recipient. You can include multiple email addresses, separated by commas. Note that everyone who receives a copy of the message will be able to see the list of recipients in the To field. If you want to send multiple emails without disclosing addresses, use the "bcc" field.
Return values
selffrom_json()
Parse JSON data into an instance of this class.
public
static from_json(string|array<string|int, mixed> $json) : self
Parameters
- $json : string|array<string|int, mixed>
-
JSON data to parse.
Return values
selfgetBcc()
public
getBcc() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetCc()
public
getCc() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetReplyTo()
public
getReplyTo() : string|null
Return values
string|nullgetReturnPath()
public
getReturnPath() : string|null
Return values
string|nullgetSubject()
public
getSubject() : string
Return values
stringgetTo()
public
getTo() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulljsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>setBcc()
public
setBcc(array<string|int, mixed>|null $bcc) : void
Parameters
- $bcc : array<string|int, mixed>|null
setCc()
public
setCc(array<string|int, mixed>|null $cc) : void
Parameters
- $cc : array<string|int, mixed>|null
setReplyTo()
public
setReplyTo(string|null $replyTo) : void
Parameters
- $replyTo : string|null
setReturnPath()
public
setReturnPath(string|null $returnPath) : void
Parameters
- $returnPath : string|null
setSubject()
public
setSubject(string $subject) : void
Parameters
- $subject : string
setTo()
public
setTo(array<string|int, mixed>|null $to) : void
Parameters
- $to : array<string|int, mixed>|null