Using the Marketing app
Email Marketing App/functionality allows sending bulk followup emails to Subscribers
after a predefined number of days from their instance activation. The app allows scheduling and personalizing the emails using django templates. Some of the usage examples include:
- Sending email to all users on the 25th day of their trial to remind them of the trial ending.
- Sending emails to users on the 10th day of their trial explaining additional features and services offered by Opencraft.
- Sending a feedback form after their end of trial.
Configuration Settings
marketing
app uses following django settings for configuration:
MARKETING_DELETE_FOLLOWUP_EMAILS_AFTER_DAYS
: Anint
value for the number of days after which a sent email record will be deleted from the database. Defaults to30
.MARKETING_EMAIL_SENDER
: The sender email address for marketing emails.MARKETING_EMAIL_REPORT_RECIPIENTS
: A list of email addresses who will recieve the report email.
Email Templates
Creating a new followup email template
To create a new followup email template:
- Visit page
/admin/marketing/emailtemplate/add/
on the OCIM admin. - Fill in the required fields (
name
,subject
,html_body
,plaintext_body
andsend_after_days
). - The fields
subject
,plaintext_body
andhtml_body
support complete django templating (explained below). - Keep the is_active field unchecked and make it active after testing the template (explained below)
- Click on the
Save
button to create the new email template.
Personalising the email template
Each template (subject, plaintext_body and html_body) are provided with some user information variables which can be used in the template to provide a personalized followup email.
Basic template variable usage
Following are the variables available in the templates:
full_name
: The full name of P&T or trial user stored in the profile model- username
subdomain
: The instance subdomain associated with the application instance.instance_name
: The instance_name associated with the application instance.application
: This is an instance of the BetaTestApplication and can be used to retrieve all other information related to the application instance.
Value of these variables can be used by wrapping them with double curly brackets ( {{ variable_name }}
) in the templates.
Following is a sample template using some of these variables:
Welcome {{ full_name }}!
Your Open edX instance {{ instance_name }} is ready!
Thank you for signing up with OpenCraft!
We are very excited to have you onboard.
If you need anything, or have any questions or suggestions,
don’t hesitate to reply to this email.
Advanced template features
Two reusable templates defined in OCIM source can also be used in your Email Templates
emails/_email_signature.html
: This template can be used to add the default signature to the emails. Add{% include “emails/_email_signature.html %}
in any html body where you wish to include the default signature.emails/email_base.html
: This template contains the default styling of an OpenCraft email and can be used as base for the html body of your email templates (see image below). Add{% extends "emails/email_base.html" %}
at the beginning of html body and include the content inside as{% block content %} <your content here> {% endblock %}
The following screenshot represents these special email components:
Following is a sample email template using the advanced features:
{% extends "emails/email_base.html" %}
{% block content %}
<p>Hello {{ full_name }},</p>
<p>Click the following link to receive a fresh pizza for free every week:
<a href="https://pizza.com">https://pizza.com</a>
</p>
<p>Thanks for your consideration.</p>
<p>Best, </p>
<p>Joe Pizza</p>
{% include "emails/_email_signature.html" %}
{% endblock %}
Testing the email templates
Make sure to test the email templates before marking them active and actually sending them to our users. Following are the instructions to test them before activating:
- Open email templates in admin ( admin/marketing/emailtemplate/ )
- Select the email template to test.
- Select
Send sample email for selected templates
from the action dropdown at the bottom of the page and hit the Go button.
You should receive an email in your inbox shortly with some dummy data populated for the application.
Subscribers
Subscribers are a list of users who will receive the followup emails. A user not added to the Subscriber list will not receive any emails.
Adding a Subscriber
A user is automatically added to the subscriber list when the first appserver is provisioned and made active.
To add a new subscriber manually
- Visit /admin/marketing/subscriber/add/ on the OCIM site
- Fill in the user details
- Make sure to check the “Receive followup” checkbox. You can uncheck this field later to unsubscribe a user.
- Click on Save button to save the changes.
Note
- Emails are triggered everyday at 0100 hrs UTC and a report is sent to all the email addresses set in
MARKETING_EMAIL_REPORT_RECIPIENTS
setting, containing a list of all the emails sent afterwards. - Sent emails can be checked at
/admin/marketing/sentemail/
on admin website. - The app does not send any emails that are already delivered to the user.
Subscriber
fieldTrial started at
andEmailTemplate
fieldSend after days
are compared to determine if an email has to be sent today.