Skip to content
Permalink
Browse files

Add priority to Email.

  • Loading branch information...
dereuromark committed Feb 2, 2017
1 parent 08c5c88 commit 31417c2567aa72d1289141cb20d4416a91defb27
Showing with 586 additions and 532 deletions.
  1. +32 −0 src/Mailer/Email.php
  2. +554 −532 tests/TestCase/Mailer/EmailTest.php
@@ -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
*
@@ -1118,6 +1125,10 @@ public function getHeaders(array $include = [])
}
}
if ($this->_priority) {
$headers['X-Priority'] = $this->_priority;
}
if ($include['subject']) {
$headers['Subject'] = $this->_subject;
}
@@ -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.
*
Oops, something went wrong.

0 comments on commit 31417c2

Please sign in to comment.
You can’t perform that action at this time.