Template Variables and Overrides

Template Variables and Overrides

Better Sharing offers several template variables with fallbacks that can be overridden.

Variables

  • greeting – Used as the salutation in Email Templates. Can be overridden. Defaults to “there” when recipient’s first name is not available.
  • referral_link – The link that will be shared. Can be overridden.
  • sender_custom_message – A placeholder in an Email Template for a custom message to be written by the sender. Cannot be overridden.
  • sender_first_name – The sender’s first name. Can be overridden. Defaults to “your friend” when the sender’s first name is not available.
  • email_message – The message in Email Templates. Can be overridden. Fallback can be specified in UI Templates.
  • x_message – The pre-loaded message in X posts. Can be overridden. Fallback can be specified in UI Templates.

Overrides

The fallbacks and defaults can be overridden in two ways.
  1. With an itemprop meta tag on the page.
  2. With shortcode attributes.

For the itemprop meta tags, a bswp_ prefix must be added to the property name or attribute name in order to correctly identify the template variable to be overridden.

Meta tag examples:
<meta itemprop="bswp_email_message" content="This gizmo is on sale for only $9.99!" />

<meta itemprop="bswp_referral_link" content="<?php echo $custom_link ?>" />

Shortcode attribute example:
[better-sharing id=1 email_message="This gizmo is on sale for only $9.99!"]

    • Related Articles

    • Create a Better Sharing email template

      Here you can create and save a variety of templates for all your outgoing email needs. The plugin includes an easy accessible list of variables for personalising outgoing emails. These can be used to include custom messages, sender’s name, and ...
    • Create a Better Sharing UI template

      Selecting the "Add UI Template" option from the top of the page. Set your preferences for the look, feel, and behavior of the user interface. There are 4 tabs in UI Template creation – Main, Social Networks, Referral Link, and Email. Main The main ...
    • Create a Better Sharing template, email template, and customize the UI

      1. To insert your UI template on any page – add our Gutenberg block or shortcode If you’re using an AddOn other than the IgnitionDeck AddOn, you don’t need a UI template. For the IgnitionDeck AddOn UI template, see UI Template for IgnitionDeck 2. ...
    • Customizing the Better Sharing Email Template for IgnitionDeck

      Better Sharing automatically creates a sharing block and email template that can be further customized. The email template, located in Better Sharing » Email Templates, can be edited to accomodate custom messaging and has a set variables that are ...
    • Troubleshooting Better Sharing

      Sharing Modal will not open (or close) This is most likely a Javascript issue either due to Javascript not being enabled in the browser or a conflict with another element on the page. Try a different browser, or temporarily switch themes / disable ...