Skip to content

Commit 597ea64

Browse files
committed
review comments
1 parent 1d623f3 commit 597ea64

File tree

4 files changed

+76
-16
lines changed

4 files changed

+76
-16
lines changed

articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-get-started-java.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ First, create a MessageTemplate using the values for a template.
235235
Here's MessageTemplate creation using a default template, `sample_template`.
236236
If `sample_template` isn't available to you, skip to [Option 2](#option-2-initiate-conversation-from-user). For advanced users, see the page [Templates](../../../../../concepts/advanced-messaging/whatsapp/template-messages.md) to understand how to send a different template with Option 1.
237237

238+
Messages SDK allows Contoso to send templated WhatsApp messages to WhatsApp users. To send template messages below details are required:
239+
- WhatsApp Channel ID
240+
- Recipient Phone Number in E16 format
241+
- Template details
242+
- Name like 'sample_template'
243+
- Language like 'en_us'
244+
- Parameters if any
245+
238246
```java
239247
// Assemble the template content
240248
String templateName = "sample_template";
@@ -267,15 +275,20 @@ To do so, from your personal WhatsApp account, send a message to your business n
267275

268276
### Send a text message to a WhatsApp user
269277

278+
Messages SDK allows Contoso to send text WhatsApp messages, which initiated WhatsApp users initiated. To send text messages below details are required:
279+
- WhatsApp Channel ID
280+
- Recipient Phone Number in E16 format
281+
- Message body/text to be sent
282+
270283
> [!IMPORTANT]
271284
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
272285
273-
In the text message, provide text to send to the recipient. In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.".
286+
In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.\n From Notification Messaging SDK".
274287

275288
Assemble then send the text message:
276289
```java
277290
// Assemble text message
278-
TextNotificationContent textContent = new TextNotificationContent(channelRegistrationId, recipientList, "“Thanks for your feedback.");
291+
TextNotificationContent textContent = new TextNotificationContent(channelRegistrationId, recipientList, "“Thanks for your feedback.\n From Notification Messaging SDK");
279292

280293
// Send text message
281294
SendMessageResult textMessageResult = notificationClient.send(textContent);
@@ -288,10 +301,14 @@ for (MessageReceipt messageReceipt : textMessageResult.getReceipts()) {
288301

289302
### Send a media message to a WhatsApp user
290303

304+
Messages SDK allows Contoso to send Image WhatsApp messages to WhatsApp users. To send Image embedded messages below details are required:
305+
- WhatsApp Channel ID
306+
- Recipient Phone Number in E16 format
307+
- MediaUri of the Image
308+
291309
> [!IMPORTANT]
292310
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
293311
294-
To send a media message, provide a URI to an image.
295312
As an example, create a URI:
296313
```java
297314
String mediaUrl = "https://aka.ms/acsicon1";

articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-get-started-js.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ First, create a MessageTemplate using the values for a template.
238238
239239
Here's MessageTemplate creation using a default template, `sample_template`.
240240
If `sample_template` isn't available to you, skip to [Option 2](#option-2-initiate-conversation-from-user). For advanced users, see the page [Templates](../../../../../concepts/advanced-messaging/whatsapp/template-messages.md) to understand how to send a different template with Option 1.
241+
242+
Messages SDK allows Contoso to send templated WhatsApp messages to WhatsApp users. To send template messages below details are required:
243+
- WhatsApp Channel ID
244+
- Recipient Phone Number in E16 format
245+
- Template details
246+
- Name like 'sample_template'
247+
- Language like 'en_us'
248+
- Parameters if any
249+
241250
```javascript
242251
// Assemble the template content
243252
const template = {
@@ -290,10 +299,15 @@ To do so, from your personal WhatsApp account, send a message to your business n
290299

291300
### Send a text message to a WhatsApp user
292301

302+
Messages SDK allows Contoso to send text WhatsApp messages, which initiated WhatsApp users initiated. To send text messages below details are required:
303+
- WhatsApp Channel ID
304+
- Recipient Phone Number in E16 format
305+
- Message body/text to be sent
306+
293307
> [!IMPORTANT]
294308
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
295309
296-
In the text message, provide text to send to the recipient. In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.".
310+
In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.\n From Notification Messaging SDK".
297311

298312
Assemble and send the media message:
299313
```javascript
@@ -304,7 +318,7 @@ const textMessageResult = await client.path("/messages/notifications:send").post
304318
channelRegistrationId: channelRegistrationId,
305319
to: recipientList,
306320
kind: "text",
307-
content: "Thanks for your feedback."
321+
content: "Thanks for your feedback.\n From Notification Messaging SDK"
308322
}
309323
});
310324

@@ -320,6 +334,11 @@ if (textMessageResult.status === "202") {
320334

321335
### Send a media message to a WhatsApp user
322336

337+
Messages SDK allows Contoso to send Image WhatsApp messages to WhatsApp users. To send Image embedded messages below details are required:
338+
- WhatsApp Channel ID
339+
- Recipient Phone Number in E16 format
340+
- MediaUri of the Image
341+
323342
> [!IMPORTANT]
324343
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
325344

articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-get-started-net.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ First, create a MessageTemplate using the values for a template.
290290
291291
Here's MessageTemplate creation using a default template, `sample_template`.
292292
If `sample_template` isn't available to you, skip to [Option 2](#option-2-initiate-conversation-from-user). For advanced users, see the page [Templates](../../../../../concepts/advanced-messaging/whatsapp/template-messages.md) to understand how to send a different template with Option 1.
293+
294+
Messages SDK allows Contoso to send templated WhatsApp messages to WhatsApp users. To send template messages below details are required:
295+
- WhatsApp Channel ID
296+
- Recipient Phone Number in E16 format
297+
- Template details
298+
- Name like 'sample_template'
299+
- Language like 'en_us'
300+
- Parameters if any
301+
293302
```csharp
294303
// Assemble the template content
295304
string templateName = "sample_template";
@@ -330,16 +339,21 @@ To do so, from your personal WhatsApp account, send a message to your business n
330339

331340
### Send a text message to a WhatsApp user
332341

342+
Messages SDK allows Contoso to send text WhatsApp messages, which initiated WhatsApp users initiated. To send text messages below details are required:
343+
- WhatsApp Channel ID
344+
- Recipient Phone Number in E16 format
345+
- Message body/text to be sent
346+
333347
> [!IMPORTANT]
334348
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
335349
336-
In the text message, provide text to send to the recipient. In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.".
350+
In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.\n From Notification Messaging SDK".
337351

338352
Assemble then send the text message:
339353
```csharp
340354
// Assemble text message
341355
var textContent =
342-
new TextNotificationContent(channelRegistrationId, recipientList, "Thanks for your feedback.");
356+
new TextNotificationContent(channelRegistrationId, recipientList, "Thanks for your feedback.\n From Notification Messaging SDK");
343357

344358
// Send text message
345359
Response<SendMessageResult> sendTextMessageResult =
@@ -348,10 +362,14 @@ Response<SendMessageResult> sendTextMessageResult =
348362

349363
### Send a media message to a WhatsApp user
350364

365+
Messages SDK allows Contoso to send Image WhatsApp messages to WhatsApp users. To send Image embedded messages below details are required:
366+
- WhatsApp Channel ID
367+
- Recipient Phone Number in E16 format
368+
- MediaUri of the Image
369+
351370
> [!IMPORTANT]
352371
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
353372
354-
To send a media message, provide a URI to an image.
355373
As an example, create a URI:
356374
```csharp
357375
var uri = new Uri("https://aka.ms/acsicon1");

articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-quickstart-python.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ Messages SDK allows Contoso to send templated WhatsApp messages to WhatsApp user
244244
- Language like 'en_us'
245245
- Parameters if any
246246

247+
For more examples of how to assemble your MessageTemplate and how to create your own template, refer to the following resource:
248+
- [Send WhatsApp Template Messages](../../../../../concepts/advanced-messaging/whatsapp/template-messages.md)
249+
250+
For further WhatsApp requirements on templates, refer to the WhatsApp Business Platform API references:
251+
- [Create and Manage Templates](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/)
252+
- [Template Components](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/components)
253+
- [Sending Template Messages](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates)
254+
247255
To send WhatsApp template message add below code in the send_template_message(self) function.
248256
```python
249257
input_template: MessageTemplate = MessageTemplate(
@@ -302,11 +310,12 @@ To do so, from your personal WhatsApp account, send a message to your business n
302310
Messages SDK allows Contoso to send text WhatsApp messages, which initiated WhatsApp users initiated. To send text messages below details are required:
303311
- WhatsApp Channel ID
304312
- Recipient Phone Number in E16 format
305-
- Message body to be sent
313+
- Message body/text to be sent
306314

307315
> [!IMPORTANT]
308316
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
309317
318+
In this example, we reply to the WhatsApp user with the text "Thanks for your feedback.\n From Notification Messaging SDK".
310319
```python
311320
def send_text_message(self):
312321
from azure.communication.messages import NotificationMessagesClient
@@ -317,7 +326,7 @@ Messages SDK allows Contoso to send text WhatsApp messages, which initiated What
317326
text_options = TextNotificationContent (
318327
channel_registration_id=self.channelRegistrationId,
319328
to= [self.phone_number],
320-
content="Hello World via Notification Messaging SDK.",
329+
content="Thanks for your feedback.\n From Notification Messaging SDK",
321330
)
322331

323332
# calling send() with whatsapp message details
@@ -360,6 +369,9 @@ Messages SDK allows Contoso to send Image WhatsApp messages to WhatsApp users. T
360369
> [!IMPORTANT]
361370
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
362371
372+
An example of media_uri used in sending media WhatsApp message.
373+
input_media_uri: str = "https://aka.ms/acsicon1"
374+
363375
```python
364376
def send_image_message(self):
365377
from azure.communication.messages import NotificationMessagesClient
@@ -514,9 +526,3 @@ WhatsApp Image containing Message with message id <<GUID>> was successfully sent
514526

515527
You can review and download the sample code for this quick start on [GitHub](https://github.com/Azure-Samples/communication-services-python-quickstarts/tree/main/messages-quickstart).
516528

517-
## References
518-
519-
- [Send WhatsApp Template Messages](../../../../../concepts/advanced-messaging/whatsapp/template-messages.md)
520-
- [Create and Manage Templates](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/)
521-
- [Template Components](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/components)
522-
- [Sending Template Messages](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates)

0 commit comments

Comments
 (0)