Email Notification for Subscriptions

The following functionality allows you to receive email notifications for subscription events.

Configure your store

This page is primarily related to configuring custom email notifications that are sent to the store administrators. This approach could be applied to the main store email receipt though - so that the changes impact the emails that customers receive as well.

If you want to trigger a custom email receipt just for store administrators, you'll need to enable the admin emails for specific categories in your store. To do that, while on your store admin's categories page, enable send admin email in the Email Options, input the email addresses you want to be notified in admin email(s), and then set an admin email subject.

If you want to make customisations to your main email receipt so customers see the changes as well - you will work from the emails template page in the administration, selecting custom text template in order to be able to add the custom logic there.

Newly-Created Subscription Condition

Add this snippet in the email template text area if you want to be notified whenever a customer registers a new subscription.

{% if is_new_subscription %}
{# INSERT CUSTOM CODE HERE #}
{% endif %}

Optional: Change the email subject

In case you want to modify the email subject to be more descriptive to the newly-created subscription event, add this snippet below the above snippet:

{% if is_new_subscription %}
{% set custom_subject = 'New Subscription by ' ~ billing_address.first_name ~ ' ' ~ billing_address.last_name ~ ' [' ~ order_id ~ ']' %}
{{ custom_subject|fc_output_data('email_subject') }}
{% endif %}

Optional: Don't send receipts for subscription renewals

If you don't want to send email receipts for subscription renewals, but just for initial subscription orders, subscription cancels and subscription updates, you can do that with a setting on your store's advanced settings page. Look for the “send emails for automated subscription renewals” checkbox and uncheck that to stop email receipts being sent for subscription renewals. More details on the subscriptions wiki page.

If you need to handle it conditionally within your templates though, you can add the following code below the above snippet:

{% if has_subscriptions and not is_new_subscription %}
{% set custom_subject = '' %}
{{ custom_subject|fc_output_data('email_subject') }}
{% endif %}

Cancel Subscription Condition

Add this snippet in the email template text area if you want to be notified whenever a customer cancels a subscription.

{% if is_subscription_cancel %}
{# INSERT CUSTOM CODE HERE #}
{% endif %}

Optional: Change the email subject

As with the above optional snippet, you can include this in the custom code section of the cancelled subscription condition:

{% set custom_subject = 'Cancelled Subscription by ' ~ billing_address.first_name ~ ' ' ~ billing_address.last_name ~ ' [' ~ order_id ~ ']' %}
{{ custom_subject|fc_output_data('email_subject') }}

Modify Subscription Condition

At this snippet in the email template text area if you want to be notified whenever a customer modifies a subscription.

{% if is_subscription_modification %}
{# INSERT CUSTOM CODE HERE #}
{% endif %}

You could also change the email subject as you would with the newly-added and cancelled.

Combining Conditions

Feel free to combine the conditions in one conditional statement separated by an and statement. For example:

{% set custom_subject = "" %}

{% if is_new_subscription %}
    {# New Subscription Purchase #}
    {% set custom_subject = "Welcome to your new subscription [" ~ order_id ~ "]" %}
{% elseif is_subscription_cancel %}
    {# Subscription Cancellation #}
    {% set custom_subject = "We're sorry to see you go [" ~ order_id ~ "]" %}
{% elseif is_subscription_modification %}
    {# Subscription Modification #}
    {% set custom_subject = "Your subscription has been modified [" ~ order_id ~ "]" %}
{% elseif has_subscriptions and not is_updateinfo %}
    {# Subscription Renewal #}
    {% set custom_subject = "Your subscription has been renewed [" ~ order_id ~ "]" %}
{% endif %}

{% if custom_subject != "" %}
    {# A custom subscription is set, so let's replace the default subscription #}
    {{ custom_subject|fc_output_data('email_subject') }}
{% endif %}

Site Tools