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/quickstarts/advanced-messaging/whatsapp/includes/templates/template-messages-quick-reference-net.md
+82Lines changed: 82 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Follow these steps to add required code snippets to the `messages-quickstart.py`
25
25
-[Send Template message with location in the header](#send-template-message-with-location-in-the-header).
26
26
-[Send Template message with quick reply buttons](#send-template-message-with-quick-reply-buttons).
27
27
-[Send Template message with call to action buttons with dynamic link](#send-template-message-with-call-to-action-buttons-with-dynamic-link).
28
+
-[Send Template message with call to action buttons with static link](#send-template-message-with-call-to-action-buttons-with-static-link).
### Send Template message with call to action buttons with static link
443
+
For static link we need not to include `MessageTemplateQuickAction` model as WhatsApp template has static `CallToAction` link and no input from user is required.
444
+
445
+
Template definition buttons:
446
+
```json
447
+
{
448
+
"type": "BUTTONS",
449
+
"buttons": [
450
+
{
451
+
"type": "URL",
452
+
"text": "Take Survey",
453
+
"url": "https://www.example.com/{{1}}"
454
+
}
455
+
]
456
+
}
457
+
```
458
+
459
+
#### Example
460
+
461
+
`purchase_feedback_static` template:
462
+
463
+
This sample template adds a button with a static URL link to the message. It also uses an image in the header and a text parameter in the body.
464
+
465
+
:::image type="content" source="../../media/template-messages/purchase_feedback_static_link_template.png" lightbox="../../media/template-messages/purchase_feedback_static_link_template.png" alt-text="Screenshot that shows editing URL Type in the WhatsApp manager.":::
466
+
467
+
In this sample, the header of the template requires an image:
468
+
469
+
```json
470
+
{
471
+
"type": "HEADER",
472
+
"format": "IMAGE"
473
+
},
474
+
```
475
+
476
+
The body of the template requires one text parameter:
477
+
478
+
```json
479
+
{
480
+
"type": "BODY",
481
+
"text": "Hello {{1}}, \nHope you are great day!.\n Please click on given link to explore about our program.."
482
+
},
483
+
```
484
+
485
+
The template includes a dynamic URL button with one parameter:
486
+
487
+
```json
488
+
{
489
+
"type": "BUTTONS",
490
+
"buttons": [
491
+
{
492
+
"type": "URL",
493
+
"text": "Take Survey",
494
+
"url": "https://www.example.com/"
495
+
}
496
+
]
497
+
}
498
+
```
499
+
500
+
Create one `MessageTemplateImage`, one `MessageTemplateText`. Then assemble your list of `MessageTemplateValue` and your `MessageTemplateWhatsAppBindings` by providing the parameters in the order that the parameters appear in the template content. The order also matters when defining your bindings' buttons.
0 commit comments