You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/concepts/advanced-messaging/whatsapp/includes/template-messages-examples-net.md
+81-90Lines changed: 81 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: include file
3
-
description: include file
2
+
title: Include file
3
+
description: Include file
4
4
services: azure-communication-services
5
-
author: memontic-ms
5
+
author: glorialimicrosoft
6
6
ms.service: azure-communication-services
7
7
ms.subservice: messages
8
-
ms.date: 07/12/2023
8
+
ms.date: 02/29/2024
9
9
ms.topic: include
10
10
ms.custom: include file
11
11
ms.author: memontic
@@ -15,7 +15,7 @@ ms.author: memontic
15
15
16
16
The sample template named `sample_template` takes no parameters.
17
17
18
-
:::image type="content" source="./../media/template-messages/sample-template-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_template.":::
18
+
:::image type="content" source="./../media/template-messages/sample-template-details-azure-portal.png" lightbox="./../media/template-messages/sample-template-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_template.":::
19
19
20
20
Assemble the `MessageTemplate` by referencing the target template's name and language.
21
21
@@ -30,7 +30,7 @@ var sampleTemplate = new MessageTemplate(templateName, templateLanguage);
:::imagetype="content"source="./../media/template-messages/sample-shipping-confirmation-details-azure-portal.png"alt-text="Screenshot that shows template details for template named sample_shipping_confirmation.":::
33
+
:::imagetype="content"source="./../media/template-messages/sample-shipping-confirmation-details-azure-portal.png"lightbox="./../media/template-messages/sample-shipping-confirmation-details-azure-portal.png"alt-text="Screenshot that shows template details for template named sample_shipping_confirmation.":::
### Use sample template sample_movie_ticket_confirmation
58
60
59
61
Templates can require various types of parameters such as text and images.
60
62
61
-
:::image type="content" source="./../media/template-messages/sample-movie-ticket-confirmation-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_movie_ticket_confirmation.":::
63
+
:::image type="content" source="./../media/template-messages/sample-movie-ticket-confirmation-details-azure-portal.png" lightbox="./../media/template-messages/sample-movie-ticket-confirmation-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_movie_ticket_confirmation.":::
62
64
63
65
In this sample, the header of the template requires an image:
64
66
```
@@ -88,25 +90,28 @@ var title = new MessageTemplateText("title", "Contoso");
88
90
var time = new MessageTemplateText("time", "July 1st, 2023 12:30PM");
89
91
var venue = new MessageTemplateText("venue", "Southridge Video");
90
92
var seats = new MessageTemplateText("seats", "Seat 1A");
91
-
IEnumerable<MessageTemplateValue> values = new List<MessageTemplateValue>
92
-
{
93
-
image,
94
-
title,
95
-
time,
96
-
venue,
97
-
seats
98
-
};
99
-
var bindings = new MessageTemplateWhatsAppBindings(
### Use sample template sample_happy_hour_announcement
106
111
107
112
This sample template uses a video in the header and two text parameters in the body.
108
113
109
-
:::image type="content" source="./../media/template-messages/sample-happy-hour-announcement-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_happy_hour_announcement.":::
114
+
:::image type="content" source="./../media/template-messages/sample-happy-hour-announcement-details-azure-portal.png" lightbox="./../media/template-messages/sample-happy-hour-announcement-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_happy_hour_announcement.":::
110
115
111
116
Here, the header of the template requires a video:
112
117
```
@@ -135,25 +140,23 @@ var videoUrl = new Uri("< Your .mp4 Video URL >");
135
140
var video = new MessageTemplateVideo("video", videoUrl);
136
141
var venue = new MessageTemplateText("venue", "Fourth Coffee");
137
142
var time = new MessageTemplateText("time", "Today 2-4PM");
138
-
139
-
IEnumerable<MessageTemplateValue> values = new List<MessageTemplateValue>
140
-
{
141
-
video,
142
-
venue,
143
-
time
144
-
};
145
-
var bindings = new MessageTemplateWhatsAppBindings(
146
-
header: new[] { video.Name },
147
-
body: new[] { venue.Name, time.Name });
148
-
149
-
var happyHourAnnouncementTemplate = MessageTemplate(templateName, templateLanguage, values, bindings);
### Use sample template sample_flight_confirmation
153
156
154
157
This sample template uses a document in the header and three text parameters in the body.
155
158
156
-
:::image type="content" source="./../media/template-messages/sample-flight-confirmation-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_flight_confirmation.":::
159
+
:::image type="content" source="./../media/template-messages/sample-flight-confirmation-details-azure-portal.png" lightbox="./../media/template-messages/sample-flight-confirmation-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_flight_confirmation.":::
157
160
158
161
Here, the header of the template requires a document:
159
162
```
@@ -184,25 +187,25 @@ var firstName = new MessageTemplateText("firstName", "Kat");
184
187
var lastName = new MessageTemplateText("lastName", "Larssen");
185
188
var date = new MessageTemplateText("date", "July 1st, 2023");
186
189
187
-
IEnumerable<MessageTemplateValue> values = new List<MessageTemplateValue>
188
-
{
189
-
document,
190
-
firstName,
191
-
lastName,
192
-
date
193
-
};
194
-
var bindings = new MessageTemplateWhatsAppBindings(
This sample template adds two prefilled reply buttons to the message. It also includes one text parameter in the body.
204
207
205
-
:::image type="content" source="./../media/template-messages/sample-issue-resolution-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_issue_resolution.":::
208
+
:::image type="content" source="./../media/template-messages/sample-issue-resolution-details-azure-portal.png" lightbox="./../media/template-messages/sample-issue-resolution-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_issue_resolution.":::
206
209
207
210
Here, the body of the template requires one text parameter:
@@ -273,10 +270,10 @@ This sample template adds a button with a dynamic URL link to the message. It al
273
270
If using the precreated sample template `sample_purchase_feedback`, you need to modify the URL Type of its button from `Static` to `Dynamic`.
274
271
Go to your [Message templates in the WhatsApp manager](https://business.facebook.com/wa/manage/message-templates/) and edit the template for `sample_purchase_feedback`. In the dropdown for URL Type, change it from `Static` to `Dynamic`. Include a sample URL if necessary.
275
272
276
-
:::image type="content" source="./../media/template-messages/edit-sample-purchase-feedback-whatsapp-manager.png" alt-text="Screenshot that shows editing URL Type in the WhatsApp manager.":::
273
+
:::image type="content" source="./../media/template-messages/edit-sample-purchase-feedback-whatsapp-manager.png" lightbox="./../media/template-messages/edit-sample-purchase-feedback-whatsapp-manager.png" alt-text="Screenshot that shows editing URL Type in the WhatsApp manager.":::
277
274
278
275
Now, if you view the template details in the Azure portal, you see:
279
-
:::image type="content" source="./../media/template-messages/sample-purchase-feedback-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_purchase_feedback.":::
276
+
:::image type="content" source="./../media/template-messages/sample-purchase-feedback-details-azure-portal.png" lightbox="./../media/template-messages/sample-purchase-feedback-details-azure-portal.png" alt-text="Screenshot that shows template details for template named sample_purchase_feedback.":::
280
277
281
278
In this sample, the header of the template requires an image:
282
279
```
@@ -327,22 +324,16 @@ var imageUrl = new Uri("https://aka.ms/acsicon1");
327
324
328
325
var image = new MessageTemplateImage(name: "image", uri: imageUrl);
329
326
var product = new MessageTemplateText(name: "product", text: "coffee");
330
-
var urlSuffix = new MessageTemplateQuickAction(name: "text", text: "survey-code");
331
-
332
-
IEnumerable<MessageTemplateValue> values = new List<MessageTemplateValue>
333
-
{
334
-
image,
335
-
product,
336
-
urlSuffix
337
-
};
338
-
var bindings = new MessageTemplateWhatsAppBindings(
339
-
header: new[] { image.Name },
340
-
body: new[] { product.Name },
341
-
button: new[]
342
-
{
343
-
new KeyValuePair<string, MessageTemplateValueWhatsAppSubType>(urlSuffix.Name,
344
-
MessageTemplateValueWhatsAppSubType.Url)
345
-
});
346
-
347
-
var purchaseFeedbackTemplate = new MessageTemplate(templateName, templateLanguage, values, bindings);
327
+
var urlSuffix = new MessageTemplateQuickAction(name: "text") { Text = "survey-code" };
0 commit comments