Save This has arrived!

Using your own custom email template

Requires 2.24.0 or above

Hubbub Pro+’s Save This feature comes with a pre-built email template that you are able to customize via the settings or through a variety of filters.

For a more advanced approach, you can completely override the provided email template with your own. Here is how you do that.

Create the email template HTML file #

First, you’ll need an email template file named save-this-email-template.html

Within this template you can use any combination of the following merge fields that will be replaced by Save This when the email is being sent.

Merge FieldPurpose
{{SITEURL}}The website’s root URL.
{{SITELOGO}}An image element that includes the email image provided in Save This settings.
{{SITETITLE}}The name of the website from the WordPress General settings.
{{EMAILMESSAGE}}The email message field from the Save This settings (which may include merge fields).
{{FEATUREDIMAGE}}The featured image set for the post being shared.
{{URL}}The URL of the post/page being Saved.
{{RAWURL}}This is used when we display the entire URL within the email.
{{BOTTOMCONTENT}}The bottom content field from the Save This settings (which may include merge fields).

Note: Of course, you can omit all of these entirely and create your own email template process using the provided filters and actions.

Where to store the email template HTML file #

Your custom email template HTML file can be stored in either of two places – one taking precedence over the other.

  1. In Your Uploads Directory – Create a folder named /hubbub/ in your website’s uploads directory and store the file there. Save This will look for this file first.
  2. In your Theme Directory – Create a folder named /hubbub/ in your website’s current theme directory and store the file there. If Save This does not find the file in your Uploads Directory, it will look here second. If you are using a Child Theme, you would include this file in your Child Theme’s directory.

But what if you do not want to store this file in your uploads directory or your theme directory? We suggest using the hubbub_save_this_filter_html_template filter to provide the HTML template. By giving this filter an HTML string of the entire template, you will override the default one and you can store the file anywhere you’d like.

Was this content helpful?
Updated on October 2, 2024