File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,14 @@ To view an email call **->find($id)** followed by the id of the email.
134
134
MsGraph::emails()->find($id);
135
135
```
136
136
137
+ Retrieve the emails using singleValueExtendedProperties.
138
+
139
+ ``` php
140
+ MsGraph::emails()->get([
141
+ '\$filter' => 'singleValueExtendedProperties/Any(ep: ep/id eq \'String {00020329-0000-0000-C000-000000000046} Name CustomProperty\' and ep/value eq \'CustomValue\')'
142
+ ]);
143
+ ```
144
+
137
145
## Send Email
138
146
139
147
To send an email the format is different to normal calls. The format is to call multiple methods to set the email properties.
@@ -172,6 +180,22 @@ MsGraph::emails()
172
180
->send()
173
181
```
174
182
183
+ singleValueExtendedProperties() can be used to add custom properties to the email.
184
+
185
+ ``` php
186
+ MsGraph::emails()
187
+
188
+ ->subject('the subject')
189
+ ->body('the content')
190
+ ->singleValueExtendedProperties([
191
+ [
192
+ "id" => "String {00020329-0000-0000-C000-000000000046} Name CustomProperty",
193
+ "value" => "CustomValue"
194
+ ]
195
+ ])
196
+ ->send()
197
+ ```
198
+
175
199
## Forward Email
176
200
177
201
To forward to an email call ** ->forward()** and use ** ->comment()** instead of ** ->body()** .
@@ -205,7 +229,3 @@ To delete an email call **->delete($id)** followed by the id of the email.
205
229
``` php
206
230
MsGraph::emails()->delete($id);
207
231
```
208
-
209
-
210
-
211
-
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ class Emails extends MsGraph
27
27
28
28
private array $ attachments = [];
29
29
30
+ private array $ singleValueExtendedProperties = [];
31
+
30
32
public function id (string $ id ): static
31
33
{
32
34
$ this ->id = $ id ;
@@ -246,6 +248,7 @@ protected function prepareEmail(): array
246
248
$ cc = $ this ->cc ;
247
249
$ bcc = $ this ->bcc ;
248
250
$ attachments = $ this ->attachments ;
251
+ $ singleValueExtendedProperties = $ this ->singleValueExtendedProperties ;
249
252
250
253
$ toArray = [];
251
254
foreach ($ to as $ email ) {
@@ -274,6 +277,14 @@ protected function prepareEmail(): array
274
277
];
275
278
}
276
279
280
+ $ singleValueExtendedPropertiesarray = [];
281
+ foreach ($ singleValueExtendedProperties as $ value ) {
282
+ $ singleValueExtendedPropertiesarray [] = [
283
+ 'id ' => $ value ['id ' ],
284
+ 'value ' => $ value ['value ' ],
285
+ ];
286
+ }
287
+
277
288
$ envelope = [];
278
289
if ($ subject !== '' ) {
279
290
$ envelope ['message ' ]['subject ' ] = $ subject ;
You can’t perform that action at this time.
0 commit comments