Added tagging ability to MessageBuilder

This commit is contained in:
Travis Swientek 2013-08-03 14:56:38 -07:00
parent ee2a9aece8
commit 449431b5c1

View File

@ -17,6 +17,7 @@ class MessageBuilder extends Messages{
protected $attachmentCount = 0;
protected $campaignIdCount = 0;
protected $customOptionCount = 0;
protected $tagCount = 0;
protected $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){
if(filter_var($enabled, FILTER_VALIDATE_BOOLEAN)){
$enabled = "yes";