Skip to content

Commit 31417c2

Browse files
committed
Add priority to Email.
1 parent 08c5c88 commit 31417c2

File tree

2 files changed

+586
-532
lines changed

2 files changed

+586
-532
lines changed

src/Mailer/Email.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ class Email implements JsonSerializable, Serializable
264264
*/
265265
protected $_boundary = null;
266266

267+
/**
268+
* Contains the optional priority of the email.
269+
*
270+
* @var int|null
271+
*/
272+
protected $_priority = null;
273+
267274
/**
268275
* An array mapping url schemes to fully qualified Transport class names
269276
*
@@ -1118,6 +1125,10 @@ public function getHeaders(array $include = [])
11181125
}
11191126
}
11201127

1128+
if ($this->_priority) {
1129+
$headers['X-Priority'] = $this->_priority;
1130+
}
1131+
11211132
if ($include['subject']) {
11221133
$headers['Subject'] = $this->_subject;
11231134
}
@@ -1829,6 +1840,27 @@ public function message($type = null)
18291840
return $this->_message;
18301841
}
18311842

1843+
/**
1844+
* Sets priority.
1845+
*
1846+
* @param int|null $priority 1 (highest) to 5 (lowest)
1847+
* @return $this
1848+
*/
1849+
public function setPriority($priority) {
1850+
$this->_priority = $priority;
1851+
1852+
return $this;
1853+
}
1854+
1855+
/**
1856+
* Gets priority.
1857+
*
1858+
* @return int
1859+
*/
1860+
public function getPriority() {
1861+
return $this->_priority;
1862+
}
1863+
18321864
/**
18331865
* Sets transport configuration.
18341866
*

0 commit comments

Comments
 (0)