Skip to content

Commit

Permalink
Add priority to Email.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Feb 2, 2017
1 parent 08c5c88 commit 31417c2
Show file tree
Hide file tree
Showing 2 changed files with 586 additions and 532 deletions.
32 changes: 32 additions & 0 deletions src/Mailer/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ class Email implements JsonSerializable, Serializable
*/
protected $_boundary = null;

/**
* Contains the optional priority of the email.
*
* @var int|null
*/
protected $_priority = null;

/**
* An array mapping url schemes to fully qualified Transport class names
*
Expand Down Expand Up @@ -1118,6 +1125,10 @@ public function getHeaders(array $include = [])
}
}

if ($this->_priority) {
$headers['X-Priority'] = $this->_priority;
}

if ($include['subject']) {
$headers['Subject'] = $this->_subject;
}
Expand Down Expand Up @@ -1829,6 +1840,27 @@ public function message($type = null)
return $this->_message;
}

/**
* Sets priority.
*
* @param int|null $priority 1 (highest) to 5 (lowest)
* @return $this
*/
public function setPriority($priority) {
$this->_priority = $priority;

return $this;
}

/**
* Gets priority.
*
* @return int
*/
public function getPriority() {
return $this->_priority;
}

/**
* Sets transport configuration.
*
Expand Down
Loading

0 comments on commit 31417c2

Please sign in to comment.