Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:snippets:email_notifications_subscriptions [2017/04/25 22:54] – typo marijav:2.0:snippets:email_notifications_subscriptions [2023/05/02 12:17] (current) – [Combining Conditions] adam
Line 5: Line 5:
 ===== Configure your store ===== ===== Configure your store =====
  
-While on your store admin'[[https://admin.foxycart.com/admin.php?ThisAction=ManageProductCategories|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**.+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'**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 ===== ===== Newly-Created Subscription Condition =====
  
-Add this snippet in the **admin text email template** if you want to be notified whenever a customer registers a new subscription.+Add this snippet in the email template text area if you want to be notified whenever a customer registers a new subscription.
  
 <code javascript> <code javascript>
Line 39: Line 43:
 ===== Cancel Subscription Condition ===== ===== Cancel Subscription Condition =====
  
-At this snippet in the **admin text email template** if you want to be notified whenever a customer cancels a subscription.+Add this snippet in the email template text area if you want to be notified whenever a customer cancels a subscription.
  
 <code javascript>{% if is_subscription_cancel %} <code javascript>{% if is_subscription_cancel %}
Line 56: Line 60:
 ===== Modify Subscription Condition ===== ===== Modify Subscription Condition =====
  
-At this snippet in the **admin text email template** if you want to be notified whenever a customer modifies a subscription.+At this snippet in the email template text area if you want to be notified whenever a customer modifies a subscription.
  
 <code javascript>{% if is_subscription_modification %} <code javascript>{% if is_subscription_modification %}
Line 67: Line 71:
 ===== Combining Conditions ===== ===== Combining Conditions =====
  
-Feel free to combine the conditions in one conditional statement separated by an **and** statement.+Feel free to combine the conditions in one conditional statement separated by an **and** statement. For example: 
 + 
 +<code> 
 +{% 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 %} 
 +</code>

Site Tools