gabrieldwight / Whatsapp-Business-Cloud-Api-Net

This is C# wrapper of whatsapp business cloud api for .NET
MIT License
283 stars 104 forks source link

Line break is not applying in whatsapp messages #48

Closed stackmanoj closed 11 months ago

stackmanoj commented 11 months ago

Describe the bug I want to send a message with line break. As per whatsapp API guide line we can send \n in message for line break. I have tried this in postman directly there it is working but not working with this nuget.

To Reproduce Steps to reproduce the behavior:

I am calling send message like

TextMessageReplyRequest request = new();
request.To = "phone numbe";
request.Text = new WhatsAppText();
request.Text.Body = "Hello,\nWelcome here";
request.Text.PreviewUrl = false;
_whatsAppBusinessClient.SendTextMessageAsync(request);

Expected behavior This message should be delivered in two lines. but it delivered like Hello,\nWelcome here

Problem I think this is serialization problem. I have checked in fiddler, in json this message is serialized as Hello,\nWelcome here