Skip to content

Commit

Permalink
Merge pull request #300 from DavidBrogli/patch-1
Browse files Browse the repository at this point in the history
Add CcRecipients
  • Loading branch information
vgrem committed Oct 16, 2022
2 parents 3d721e2 + 03c2442 commit 59e8182
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/Outlook/Messages/Message.php
Expand Up @@ -399,6 +399,14 @@ public function getToRecipients(){
return $this->getProperty("ToRecipients",new ClientValueCollection(Recipient::class));
}


/**
* @return ClientValueCollection
*/
public function getCcRecipients(){
return $this->getProperty("CcRecipients",new ClientValueCollection(Recipient::class));
}

/**
* @param EmailAddress[] $values
* @return $this
Expand All @@ -413,6 +421,20 @@ public function setToRecipients($values){
return $this->setProperty("ToRecipients", ClientValueCollection::fromArray(Recipient::class,$values));
}


/**
* @param EmailAddress[] $values
* @return $this
*/
public function setCcRecipients($values){
$values = array_map(function ($value) {
if ($value instanceof EmailAddress)
return new Recipient($value);
else
return $value;
}, $values);
return $this->setProperty("CcRecipients", ClientValueCollection::fromArray(Recipient::class,$values));
}
/**
* @return EntityCollection
*/
Expand All @@ -421,4 +443,4 @@ public function getAttachments(){
new EntityCollection($this->getContext(),$this->getResourcePath(),Attachment::class));
}

}
}

0 comments on commit 59e8182

Please sign in to comment.