This is an old revision of the document!
Table of Contents
Email Notification for Subscriptions
The following functionality allows you to receive email notifications for subscription events.
Configure you store
While on your store admin's Manage Product Categories, 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.
Newly-Created Subscription Condition
At this snippet in the admin text email template if you want to be notified whenever a customer registers a new subscription.
{% set is_new_sub = 0 %} {% set is_new_sub = 0 %} {% if has_subscriptions %} {% for subscription in subscriptions %} {% if subscription.original_transaction_id == transaction_id %} {% set is_new_sub = 1 %} {% endif %} {% endfor %} {% endif %} {% for item in items %} {% if item.name == "Past Due Amount" %} {% set is_new_sub = 0 %} {% endif %} {% endfor %} {# WRITE EMAIL BODY BELOW #}
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:
{% if is_new_sub and not is_subscription_cancel and not is_subscription_modification and not is_updateinfo %} {% set email_subject = 'New Subscription by ' ~ billing_address.first_name ~ ' ' ~ billing_address.last_name ~ ' [' ~ order_id ~ ']' %} {{ email_subject|fc_output_data('email_subject') }} {% endif %}
Cancel Subscription Condition
At this snippet in the admin text email template 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 email_subject = 'Cancelled Subscription by ' ~ billing_address.first_name ~ ' ' ~ billing_address.last_name ~ ' [' ~ order_id ~ ']' %} {{ email_subject|fc_output_data('email_subject') }}
Modify Subscription Condition
At this snippet in the admin text email template 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.