|
|
@@ -17,6 +17,7 @@ if (!defined('BR')) {
|
|
|
* - allow wrapLength to be adjusted
|
|
|
* - Configure::read('Config.x-mailer') can modify the x-mailer
|
|
|
* - basic validation supported
|
|
|
+ * - allow priority to be set (1 to 5)
|
|
|
*
|
|
|
* @author Mark Scherer
|
|
|
* @license MIT
|
|
|
@@ -33,6 +34,8 @@ class EmailLib extends CakeEmail {
|
|
|
|
|
|
protected $_wrapLength = null;
|
|
|
|
|
|
+ protected $_priority = null;
|
|
|
+
|
|
|
public function __construct($config = null) {
|
|
|
if ($config === null) {
|
|
|
$config = 'default';
|
|
|
@@ -485,6 +488,11 @@ class EmailLib extends CakeEmail {
|
|
|
'bcc' => $this->_bcc,
|
|
|
'transport' => $this->_transportName
|
|
|
);
|
|
|
+ if ($this->_priority) {
|
|
|
+ $this->_headers['X-Priority'] = $this->_priority;
|
|
|
+ //$this->_headers['X-MSMail-Priority'] = 'High';
|
|
|
+ //$this->_headers['Importance'] = 'High';
|
|
|
+ }
|
|
|
|
|
|
try {
|
|
|
$this->_debug = parent::send($message);
|
|
|
@@ -547,6 +555,20 @@ class EmailLib extends CakeEmail {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Set/Get priority
|
|
|
+ *
|
|
|
+ * @param int $priority 1 (highest) to 5 (lowest)
|
|
|
+ * @return int|CakeEmail
|
|
|
+ */
|
|
|
+ public function priority($priority = null) {
|
|
|
+ if ($priority === null) {
|
|
|
+ return $this->_priority;
|
|
|
+ }
|
|
|
+ $this->_priority = $priority;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Fix line length
|
|
|
*
|
|
|
* @overwrite
|