Add WhatsApp links in CodeTwo Email Signatures for Office 365

CodeTwo Email Signatures for Office 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 two most common scenarios in which WhatsApp links can be useful in email signatures:

  • If your company uses WhatsApp as one of the ways to contact users (for example for Sales or Support queries)
  • If you want to add WhatsApp links for internal communication for all or selected users.

WhatsApp link format

The WhatsApp link has the following format:

https://api.whatsapp.com/send?phone={PhoneNumber}

where {PhoneNumber} is the number associated with a WhatsApp account. 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

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 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 Exchange Admin Center to manually assign specific values to the right user attribute.

  1. Connect to Exchange Online using the Connect-ExchangeOnline cmdlet (for more information and troubleshooting, see this article)
  2. 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('+',''); <# This and the few following functions remove special characters from the number. #>
$number=$number.replace(' ','');
$number=$number.replace('-','');
$number=$number.replace('(','');
$number=$number.replace(')','');
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 WhatsApp link to an email signature rule

  1. Go to app.codetwo.com to open the signature management app, choose the signature rule you would like to edit, go to the Design tab and click Edit signature (Fig. 1.).

Editing email signature template.
Fig. 1. Editing email signature template.

  1. In the editor, place the cursor where you want the WhatsApp link to be added and click Meeting link (Fig. 2.).

ESIG Whatsapp integration 2 add a new meeting link
Fig. 2. Adding a new meeting link.

  1. The Insert meeting link window (Fig. 3.) has the following fields:
    1. Type lets you choose which meeting/chat/scheduling provider you want to direct to. Pick Custom link.
    2. 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).
    3. Label specifies the text that will be hyperlinked.
    4. 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.

ESIG Whatsapp integration 3 Insert meeting link window
Fig. 3. The insert meeting link window.

  1. 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 AAD attribute, they will not have the WhatsApp link added to their email signature. Learn more about using this option.

ESIG Whatsapp integration 4 Remobe empty placeholder option
Fig. 4. The remove empty placeholder option.

Was this information useful?