Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CcRecipients #300

Merged
merged 1 commit into from Oct 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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));
}

}
}