Skip to content

Commit ec46678

Browse files
committed
Email Service data plane - added examples
1 parent 7a0ee8a commit ec46678

File tree

6 files changed

+238
-48
lines changed

6 files changed

+238
-48
lines changed

src/Communication/CommunicationServicesEmail.Autorest/docs/Get-AzCommunicationServicesEmailSendResult.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,24 @@ Gets the status of the email send operation.
2929

3030
## EXAMPLES
3131

32-
### Example 1: {{ Add title here }}
32+
### Example 1: Gets the status and operation id of the email send operation.
3333
```powershell
34-
{{ Add code here }}
34+
get-AzCommunicationServicesemailSendResult -Endpoint "https://contoso.unitedstates.communications.azure.com" -OperationId 8540c0de-899f-5cce-acb5-3ec493af3800
3535
```
3636

3737
```output
38-
{{ Add output here (remove the output block if the example doesn't have an output) }}
38+
AdditionalInfo :
39+
Code :
40+
Detail :
41+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
42+
Message :
43+
ResourceGroupName :
44+
RetryAfter :
45+
Status : Succeeded
46+
Target :
3947
```
4048

41-
{{ Add description here }}
42-
43-
### Example 2: {{ Add title here }}
44-
```powershell
45-
{{ Add code here }}
46-
```
47-
48-
```output
49-
{{ Add output here (remove the output block if the example doesn't have an output) }}
50-
```
51-
52-
{{ Add description here }}
49+
Returns a status and operation id of the email send operation.
5350

5451
## PARAMETERS
5552

src/Communication/CommunicationServicesEmail.Autorest/docs/Send-AzCommunicationServicesEmail.md

Lines changed: 104 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,121 @@ Queues an email message to be sent to one or more recipients
4848

4949
## EXAMPLES
5050

51-
### Example 1: {{ Add title here }}
51+
### Example 1: Queues an email message to be sent to one or more recipients
5252
```powershell
53-
{{ Add code here }}
53+
$emailRecipientTo = @(
54+
@{
55+
Address = "[email protected]"
56+
DisplayName = "abc"
57+
}
58+
)
59+
60+
$message = @{
61+
ContentSubject = "Test Email"
62+
RecipientTo = @($emailRecipientTo) # Array of email address objects
63+
SenderAddress = '[email protected]'
64+
ContentPlainText = "This is the first email from ACS - HTML"
65+
}
66+
67+
send-AzCommunicationServicesEmail -Message $Message -endpoint "https://contoso.unitedstates.communications.azure.com"
5468
```
5569

5670
```output
57-
{{ Add output here (remove the output block if the example doesn't have an output) }}
71+
AdditionalInfo :
72+
Code :
73+
Detail :
74+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
75+
Message :
76+
ResourceGroupName :
77+
RetryAfter :
78+
Status : Succeeded
79+
Target :
5880
```
5981

60-
{{ Add description here }}
82+
Queues an email message to be sent to one or more recipients, above is the example with only required fields.
6183

62-
### Example 2: {{ Add title here }}
84+
### Example 2: Queues an email message to be sent to one or more recipients
6385
```powershell
64-
{{ Add code here }}
65-
```
6686
67-
```output
68-
{{ Add output here (remove the output block if the example doesn't have an output) }}
87+
$emailRecipientTo = @(
88+
@{
89+
Address = "[email protected]"
90+
DisplayName = "abc"
91+
}
92+
@{
93+
Address = "[email protected]"
94+
DisplayName = "def"
95+
}
96+
)
97+
98+
$fileBytes = [System.IO.File]::ReadAllBytes("<file path>")
99+
100+
$emailAttachment = @(
101+
@{
102+
ContentInBase64 = $fileBytes
103+
ContentType = "<text/plain>"
104+
Name = "<test.txt>"
105+
}
106+
)
107+
108+
$headers = @{
109+
"Key1" = "Value1"
110+
"Key2" = "Value2"
111+
"Importance" = "high"
112+
}
113+
114+
$emailRecipientBcc = @(
115+
@{
116+
Address = "[email protected]"
117+
DisplayName = "abc"
118+
}
119+
)
120+
121+
$emailRecipientCc = @(
122+
@{
123+
Address = "[email protected]"
124+
DisplayName = "abc"
125+
},
126+
127+
)
128+
129+
$emailRecipientReplyTo = @(
130+
@{
131+
Address = "[email protected]"
132+
DisplayName = "abc"
133+
}
134+
)
135+
136+
$message = @{
137+
ContentSubject = "Test Email"
138+
RecipientTo = @($emailRecipientTo) # Array of email address objects
139+
SenderAddress = '[email protected]'
140+
Attachment = @($emailAttachment) # Array of attachments
141+
ContentHtml = "<html><head><title>Enter title</title></head><body><h1>This is the first email from ACS - HTML</h1></body></html>"
142+
ContentPlainText = "This is the first email from ACS - HTML"
143+
Header = $headers # Importance = high/medium/low or X-Priority = 2/3/4
144+
RecipientBcc = @($emailRecipientBcc) # Array of email address objects
145+
RecipientCc = @($emailRecipientCc) # Array of email address objects
146+
ReplyTo = @($emailRecipientReplyTo) # Array of email address objects
147+
UserEngagementTrackingDisabled = $true
148+
}
149+
150+
send-AzCommunicationServicesEmail -Message $Message -endpoint "https://contoso.unitedstates.communications.azure.com"
69151
```
70152

71-
{{ Add description here }}
153+
```output
154+
AdditionalInfo :
155+
Code :
156+
Detail :
157+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
158+
Message :
159+
ResourceGroupName :
160+
RetryAfter :
161+
Status : Succeeded
162+
Target :
163+
```
164+
165+
Queues an email message to be sent to one or more recipients, above is the example with all the fields.
72166

73167
## PARAMETERS
74168

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Gets the status and operation id of the email send operation.
22
```powershell
3-
{{ Add code here }}
3+
get-AzCommunicationServicesemailSendResult -Endpoint "https://contoso.unitedstates.communications.azure.com" -OperationId 8540c0de-899f-5cce-acb5-3ec493af3800
44
```
55

66
```output
7-
{{ Add output here (remove the output block if the example doesn't have an output) }}
7+
AdditionalInfo :
8+
Code :
9+
Detail :
10+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
11+
Message :
12+
ResourceGroupName :
13+
RetryAfter :
14+
Status : Succeeded
15+
Target :
816
```
917

10-
{{ Add description here }}
11-
12-
### Example 2: {{ Add title here }}
13-
```powershell
14-
{{ Add code here }}
15-
```
16-
17-
```output
18-
{{ Add output here (remove the output block if the example doesn't have an output) }}
19-
```
20-
21-
{{ Add description here }}
18+
Returns a status and operation id of the email send operation.
2219

Lines changed: 102 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,116 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Queues an email message to be sent to one or more recipients
22
```powershell
3-
{{ Add code here }}
3+
$emailRecipientTo = @(
4+
@{
5+
Address = "[email protected]"
6+
DisplayName = "abc"
7+
}
8+
)
9+
10+
$message = @{
11+
ContentSubject = "Test Email"
12+
RecipientTo = @($emailRecipientTo) # Array of email address objects
13+
SenderAddress = '[email protected]'
14+
ContentPlainText = "This is the first email from ACS - HTML"
15+
}
16+
17+
send-AzCommunicationServicesEmail -Message $Message -endpoint "https://contoso.unitedstates.communications.azure.com"
418
```
519

620
```output
7-
{{ Add output here (remove the output block if the example doesn't have an output) }}
21+
AdditionalInfo :
22+
Code :
23+
Detail :
24+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
25+
Message :
26+
ResourceGroupName :
27+
RetryAfter :
28+
Status : Succeeded
29+
Target :
830
```
931

10-
{{ Add description here }}
32+
Queues an email message to be sent to one or more recipients, above is the example with only required fields.
1133

12-
### Example 2: {{ Add title here }}
34+
### Example 2: Queues an email message to be sent to one or more recipients
1335
```powershell
14-
{{ Add code here }}
36+
37+
$emailRecipientTo = @(
38+
@{
39+
Address = "[email protected]"
40+
DisplayName = "abc"
41+
}
42+
@{
43+
Address = "[email protected]"
44+
DisplayName = "def"
45+
}
46+
)
47+
48+
$fileBytes = [System.IO.File]::ReadAllBytes("<file path>")
49+
50+
$emailAttachment = @(
51+
@{
52+
ContentInBase64 = $fileBytes
53+
ContentType = "<text/plain>"
54+
Name = "<test.txt>"
55+
}
56+
)
57+
58+
$headers = @{
59+
"Key1" = "Value1"
60+
"Key2" = "Value2"
61+
"Importance" = "high"
62+
}
63+
64+
$emailRecipientBcc = @(
65+
@{
66+
Address = "[email protected]"
67+
DisplayName = "abc"
68+
}
69+
)
70+
71+
$emailRecipientCc = @(
72+
@{
73+
Address = "[email protected]"
74+
DisplayName = "abc"
75+
},
76+
77+
)
78+
79+
$emailRecipientReplyTo = @(
80+
@{
81+
Address = "[email protected]"
82+
DisplayName = "abc"
83+
}
84+
)
85+
86+
$message = @{
87+
ContentSubject = "Test Email"
88+
RecipientTo = @($emailRecipientTo) # Array of email address objects
89+
SenderAddress = '[email protected]'
90+
Attachment = @($emailAttachment) # Array of attachments
91+
ContentHtml = "<html><head><title>Enter title</title></head><body><h1>This is the first email from ACS - HTML</h1></body></html>"
92+
ContentPlainText = "This is the first email from ACS - HTML"
93+
Header = $headers # Importance = high/medium/low or X-Priority = 2/3/4
94+
RecipientBcc = @($emailRecipientBcc) # Array of email address objects
95+
RecipientCc = @($emailRecipientCc) # Array of email address objects
96+
ReplyTo = @($emailRecipientReplyTo) # Array of email address objects
97+
UserEngagementTrackingDisabled = $true
98+
}
99+
100+
send-AzCommunicationServicesEmail -Message $Message -endpoint "https://contoso.unitedstates.communications.azure.com"
15101
```
16102

17103
```output
18-
{{ Add output here (remove the output block if the example doesn't have an output) }}
104+
AdditionalInfo :
105+
Code :
106+
Detail :
107+
Id : 8540c0de-899f-5cce-acb5-3ec493af3800
108+
Message :
109+
ResourceGroupName :
110+
RetryAfter :
111+
Status : Succeeded
112+
Target :
19113
```
20114

21-
{{ Add description here }}
115+
Queues an email message to be sent to one or more recipients, above is the example with all the fields.
22116

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
3+
"SubscriptionId": "653983b8-683a-427c-8c27-9e9624ce9176"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47",
3+
"SubscriptionId": "653983b8-683a-427c-8c27-9e9624ce9176"
4+
}

0 commit comments

Comments
 (0)