To create a WhatsApp DM link, you can use the following format in an anchor tag:
<a href="https://api.whatsapp.com/send?phone=whatsappphonenumber&text=urlencodedtext">Send message</a>
In this code, replace "whatsappphonenumber" with the phone number of the WhatsApp user you want to message (including the country code) and "urlencodedtext" with the message you want to send (encoded using URL encoding).
For example, if you want to create a WhatsApp DM link to message the number +1-123-456-7890 with the message "Hello, how are you?", the code would look like this:
<a href="https://api.whatsapp.com/send?phone=11234567890&text=Hello%2C%20how%20are%20you%3F">Send message</a>
Note that this code will only work if the user has WhatsApp installed on their device and if they have granted permission for WhatsApp to open.