DEV Community

Cover image for WhatsApp Custom Link Message
Alexandre Freire
Alexandre Freire

Posted on • Edited on

2

WhatsApp Custom Link Message

Make custom link messages to Whatsapp with nuget package.

var waComposer = new WaComposer();
waComposer.WriteText("Pedido",1,1);
//Observation: this 1,1 is break line. 1 before and 1 after

waComposer.WriteText("Item One");

//can format - available options: Italic, Bold, Strikethrough, Monospace.
waComposer.WriteText(WaFormat.Bold("Two")); 
waComposer.WriteText(WaFormat.Italic("Example Number: ") + "3");

var textResult = waComposer.GetText();

var whatsAppLink = WaSender.GetLink("PHONE_NUMBER_HERE",textResult);

//example output of whatsAppLink 
"https://wa.me/123/?text=THE_MESSAGE_FORMATED_BY_PACKAGE_HERE"
or on mobile 
"whatsapp://send?text=THE_MESSAGE_FORMATED_BY_PACKAGE_HERE&phone=123"

Enter fullscreen mode Exit fullscreen mode

being able to stay like this for example:

Image description

Available on https://www.nuget.org/packages/WhatsAppLink/
Github https://github.com/oalexandrefreire/WhatsAppLinkCSharp

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay