mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 14:26:04 +03:00
Added tagging ability to MessageBuilder
This commit is contained in:
parent
ee2a9aece8
commit
449431b5c1
@ -17,6 +17,7 @@ class MessageBuilder extends Messages{
|
|||||||
protected $attachmentCount = 0;
|
protected $attachmentCount = 0;
|
||||||
protected $campaignIdCount = 0;
|
protected $campaignIdCount = 0;
|
||||||
protected $customOptionCount = 0;
|
protected $customOptionCount = 0;
|
||||||
|
protected $tagCount = 0;
|
||||||
protected $httpBroker;
|
protected $httpBroker;
|
||||||
|
|
||||||
public function __construct($httpBroker){
|
public function __construct($httpBroker){
|
||||||
@ -228,6 +229,22 @@ class MessageBuilder extends Messages{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addTag($tag){
|
||||||
|
if($this->tagCount < 3){
|
||||||
|
if(isset($this->message['o:tag'])){
|
||||||
|
array_push($this->message['o:tag'] , $tag);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->message['o:tag'] = array($tag);
|
||||||
|
}
|
||||||
|
$this->tagCount++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
throw new TooManyParameters("You've exceeded the maximum (3) tags for a single message.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function setDkim($enabled){
|
public function setDkim($enabled){
|
||||||
if(filter_var($enabled, FILTER_VALIDATE_BOOLEAN)){
|
if(filter_var($enabled, FILTER_VALIDATE_BOOLEAN)){
|
||||||
$enabled = "yes";
|
$enabled = "yes";
|
||||||
|
Loading…
Reference in New Issue
Block a user