Share Buttons - Customize WhatsApp Template

Follow

With Shareaholic Share Button templates you can customize the pre-filled message when sharing via WhatsApp.

${title}, ${link}, ${short_link}, ${description}, ${notes} and ${source} placeholder variables are available for the WhatsApp template. These will be dynamically substituted with the actual values. All template variables are optional. You can also use ${meta:____} placeholder variables to substitute from your page's meta tags, for example ${meta:og:title}.

There are two ways to set the WhatsApp template:

  1. Codeless method - in the Admin UI, head over to Site Profile -> Settings -> Sharing -> Sharing Settings
    mceclip0.png
    mceclip0.png
  2. Code method - 
    <div class="shareaholic-canvas"
          data-app="share_buttons"
          data-app-id-name="post_below_content"
          data-app-config='{
             "templates":{
                "whatsapp":{
                  "text":"A little hint that this caught my eye! ${link}",
                  "phone":"16171231234"
             }}}'>
     </div>
    To apply globally:
    _SHR_SETTINGS_CUSTOM = {
       config: {
         apps: {
          share_buttons: {
            templates: {
              whatsapp: {
                text: "A little hint that this caught my eye! ${link}",
                phone: "16171231234"
              },
            },
          },
        },
      },
    };

If both code and codeless methods are set, code method will take priority.

Tip: If phone is specified, a chat with the person will automatically open. If not specified, a list of contacts that you can send your message to will be shown.