Add WhatsApp links in CodeTwo Email Signatures 365
CodeTwo Email Signatures 365 allows you to insert WhatsApp links to your email signature templates. When a recipient clicks such a link in the user’s signature, it will let them start a WhatsApp chat with this particular user. If the recipient has WhatsApp installed, clicking the link will open a chat directly in the app. Otherwise, a browser will open, allowing the recipient to start the chat via the WhatsApp Web app.
There are three most common scenarios in which WhatsApp links can be useful in email signatures:
- Your company uses WhatsApp as one of the ways to contact users (for example for Sales or Support queries)
- You want to add WhatsApp links for internal communication for all or selected users.
- You want to provide an easy way to move conversations from a desktop email app to your mobile phone.
WhatsApp link format
The WhatsApp link has the following format:
https://api.whatsapp.com/send?phone={PhoneNumber}&text={custom message}
or
https://wa.me/{PhoneNumber}?text={custom message}
where {PhoneNumber} is the number associated with a WhatsApp account and {custom message} is the text that will automatically appear in the chat's message box. Recipients will be able to either use it or discard it.
The number in the link must contain digits only, without any special characters so, for example, if a user has the following number:
+1 (800) 555-0199
The WhatsApp link for this user will be:
https://api.whatsapp.com/send?phone=18005550199
or:
https://wa.me/18005550199?text=Hi. Let’s continue our email conversation here.
Since spaces aren’t really supported in URLs, paste this into your browser’s address bar and press Enter to have it automatically converted to the right format:
https://wa.me/18005550199?text=Hi!%20I%20got%20here%20from%20your%20email%20signature.
In most cases, the problem is that users’ phone attributes are formatted with spaces and various other special characters to make them more reader-friendly. So, in order to use Entra ID (Azure AD) attributes to add a phone number, you need to change its format by getting rid of all the special characters. To avoid replacing phone values with their less reader-friendly format, you can convert these numbers using the method described below and then assign them to a custom attribute.
Convert phone numbers
The method below takes the MobilePhone value of all users, converts the phone numbers’ format and assigns the new values to respective mailboxes’ custom attribute. In this example, the CustomAttribute12 is used, but you can use any other custom attribute number. If only a few specific users use WhatsApp in your organization, it’s a good idea to limit the users’ scope (in the first line of the script below), or create a signature rule for those specific users only. If you don’t want to use PowerShell, you can always convert the numbers manually and use the Exchange admin center to manually assign specific values to the right user attribute.
- Connect to Exchange Online using the Connect-ExchangeOnline cmdlet (for more information and troubleshooting, see this article)
- Run the following script (the code includes gray-colored comments, which provide more information about how it works):
$users = Get-User <# gets the list of all users in your organization. You can use the -Filter parameter to limit the number of users #> foreach ($user in $users){ <# The loop goes through all users listed in the $users array specified above #> $number = ($user.MobilePhone); <# Gets the user’s mobile phone value #> $number=$number -replace "[^0-9]"} <# This line removes all non-numerical characters from mobile phones. Thanks to this, it will be easy to apply custom formatting to all numbers at once. #> Set-Mailbox $user.UserPrincipalName -CustomAttribute12 $number <#Assigns the converted value to the CustomAttribute12 mailbox attribute #> } Get-Mailbox | FL UserPrincipalName,CustomAttribute12 <# Returns a list of mailboxes together with their CustomAttribute12 attribute. It lets you verify if the values were correctly updated.#>
When you finish setting this up, you can use the CustomAttribute12 values in the next step.
Adding a WhatsApp link to an email signature template
- Go to app.codetwo.com to open the signature management app, choose the signature rule you would like to edit, go to the Design step and click Edit signature (Fig. 1.).
Fig. 1. Editing email signature template.
- In the editor, place the cursor where you want the WhatsApp link to be added and click Meeting link (Fig. 2.).
Fig. 2. Adding a new meeting link.
- The Insert meeting link window (Fig. 3.) has the following fields:
- Type lets you choose which meeting/chat/scheduling provider you want to direct to. Choose Custom link.
- URL specifies where your recipients will be directed when they click the button. In this field, paste:
https://api.whatsapp.com/send?phone=
and use the Placeholder button to pick the right placeholder (CustomAttribute12, if you followed the instructions from Convert phone numbers). - Label specifies the text that will be hyperlinked.
- Picture lets you choose an icon which will act as a WhatsApp chat button.
Note that when it comes to the Label and Picture fields, you can use either of them, or both.
Fig. 3. The insert meeting link window.
- Finally, you can highlight the WhatsApp link with your mouse and use the Remove empty placeholder option (Fig. 4.). This way, if a user doesn’t have the Entra ID (Azure AD) attribute, they will not have the WhatsApp link added to their email signature. Learn more about using this option.
Fig. 4. The remove empty placeholder option.
Adding a WhatsApp link as a QR code
Another idea for an email signature is to add WhatsApp links in a form of QR codes. This way, you’ll allow recipients to quickly move conversations from emails to a mobile WhatsApp.
- Go to app.codetwo.com to open the signature management app, choose the signature rule you would like to edit, go to the Design step and click Edit signature (Fig. 1.).
- In the editor, place the cursor where you want the QR WhatsApp link to be added, go to Placeholder > Other and then click QR Code image (Fig. 5.).
Fig. 5. The option to add a QR Code image.
- Size of image lets you control the resolution of you QR code. Text is the URL where you paste: https://api.whatsapp.com/send?phone= and use the Placeholder button to select the right placeholder (CustomAttribute12, if you followed the instructions from Convert phone numbers). If you also add the text URL parameter, as shown in Fig. 6., you can add an initial message that will appear when your recipient enters the WhatsApp chat. Remember that e.g. spaces aren’t supported in URLs, so they need to be replaced with their respective entities (for example, %20). Go to WhatsApp link format to see how to easily convert spaces to their entities. When you’re done, click OK.
Fig. 6. The QR Code image window.
- The QR Code image placeholder will be added to your email signature template (Fig. 7.).
Fig. 7. QR Code image placeholder in a sample signature.
The WhatsApp QR Code will be automatically generated for each employee in their respective email signature.