@@ -28,7 +28,22 @@ By calling `SendTextMessage` and providing message text, sender name, recipient
28
28
client .sendTextMessage (" Message Text" , " TestSender" , new String [] {" 00316012345678" });
29
29
30
30
```
31
+ ## Sending a message with auto detect encoding
32
+ By using the ` MessageBuilder ` it is possible to send messages with auto detect encoding,
31
33
34
+ It is possible to let our gateway detect the encoding for you by including the type: auto setting.
35
+ In case it detects characters that are not part of the GSM character set, the message will be delivered as Unicode.
36
+
37
+ see our API docs for more info https://docs.cmtelecom.com/en/api/business-messaging-api/1.0/index/
38
+
39
+ ``` cs
40
+ MessagingClient client = new MessagingClient (" YourProductToken" );
41
+ MessageBuilder builder = new MessageBuilder (" Message Text" , " auto" , " TestSender" , new String [] {" 00316012345678" });
42
+
43
+ Message message = builder .Build ();
44
+
45
+ client .sendMessage (message );
46
+ ```
32
47
33
48
## Sending a rich message
34
49
By using the ` MessageBuilder ` it is possible to create images with media for channels such as WhatsApp and Viber
@@ -72,9 +87,9 @@ Sending an message returns the response body
72
87
73
88
MessagingClient client = new MessagingClient (" YourProductToken" );
74
89
75
- MessageBuilder builder = new MessageBuilder (" Template Test" , " CM.COM" , new String [] {" 0031636170815" });
90
+ MessageBuilder builder = new MessageBuilder (" Template Test" , " CM.COM" , new String [] {" 0031636170815" });
76
91
77
- builder .WithAllowedChannels (new Channel [] {Channel .WhatsApp });
92
+ builder .WithAllowedChannels (new Channel [] {Channel .WhatsApp });
78
93
79
94
TemplateMessage template = new TemplateMessage ();
80
95
@@ -91,14 +106,14 @@ builder.WithAllowedChannels(new Channel[] {Channel.WhatsApp});
91
106
" image/png" ))}),
92
107
new TemplateComponents (" body" ,
93
108
new TemplateParameters [] { new TemplateParameters (" text" , " TestMessage" ),
94
- new TemplateParameters (" text" , " CM.Com " )})};
109
+ new TemplateParameters (" text" , " Dutch GP " )})};
95
110
96
111
97
- builder .WithTemplate (template );
112
+ builder .WithTemplate (template );
98
113
99
- Message message = builder .Build ();
114
+ Message message = builder .Build ();
100
115
101
- client .sendMessage (message );
116
+ client .sendMessage (message );
102
117
```
103
118
104
119
0 commit comments