How To Set Up an Order Follow Up Email

1. Define the orders whose customers should be sent a follow up email.

From the main Orders grid screen, use the filters and keyword search, to create the criteria of which orders should be included in the follow up email.

image-20240314105912641

In this example, the filters limit the orders by the Placed On date. In addition we have added another filter to limit the orders to those that were for a particular item. Any set of filters can be applied. For full details on how to use the grid screen and filters, see the Administrator Grid Screens document.

Using the Placed On date as this one does is a common approach:

image-20240314110005173

Note the above criteria (from 30 days ago to 7 days ago) is a rolling criteria. This means we can reuse the report and have the job send follow up emails on a nightly basis. The follow up job (see below) keeps track of which orders it has sent emails for, and will not resend the same notification for the same order.

Other filter options for rolling dates

The above example filters on orders that were placed between 30 days ago to 7 days ago. Using the Additional Filters (RSQL) input, you can get more specific than that if you wish. As an example, adding the following expression to Additional Filters (RSQL) will filter for orders that were placed exactly 45 days ago:

order.placedOn>='DaysAgo46' and order.placedOn<'DaysAgo45'

Note, any number may be used in place of "46" and "45" in the above expression.

2. Create a report from the filtered grid screen you've set up.

Once you have defined which orders to send follow ups to, create a report from the filters you've defined. Under the three dots menu, select Save Page as Report:

image-20240314105941039

On the next screen, give the report a name and code to describe it. Note the code you give the report - you'll use this later to set up the follow up job. Click Add New Record to save the report.

image-20240314105821559

Under Report Parameters, you can set the Size field to limit the number of records in the report - and thus, the number of emails that are sent out. If you do not define the Size field, it defaults to 1000, which is the maximum number of emails produced by each run of the job. Setting the Size field to a very low number initially can be a good way to test the whole process.

3. Review and if necessary edit the Notification and Template for the follow up job.

A notification and template is provided for you for follow up emails related to orders, but it may not be exactly what you want to send your customers. You should find and review both the notification and the email template it uses. Under Notifications, click into the Order Follow Up Job Notification:

image-20240314110350284

In particular, review the notification's "Tos" field under Message Fields. By default the notification sends emails to the customer's billing email address. This is probably suitable for most cases but you might prefer to send them to the delivery email address, for example.

Next, click into the notification's Template, which by default has the same name as the notification (Order Follow Up Job Notification). Review the messaging and layout of the template, including the Email Subject field and Email Body field. Make any necessary changes.

Note, it is often a good idea to create a new notification and/or template, particularly if you are setting up multiple follow up reports based on different criteria. For full details on how to do this, see the Notification Features document.

4. Configure the follow up job with the report and the notification you would like to use.

The last step is to configure the site job. Tell it to use your notification to send an email for each of the orders in the report you created.

Set up the Site Job

The system comes configured with a default Order Follow Up Job under Operations -> Site Jobs. You can reuse this job or set up a new one. If you set up a new one, just make sure it uses the "Order Follow Up Job" site function for the job's Site Function field.

image-20240314111145278

You'll note by default this job's Is Active flag is off. We suggest you keep it off until you've finished configuring it with the below steps.

If your report has a rolling criteria, like our above example, it might make sense to set the Frequency of the job to Nightly or another recurring value. However, it's also possible to just have the system send out the follow up emails once, in which case you can select "Once and Done" for the Frequency.

For Next Fire Time, note that any date in the past will cause the job to run within a few minutes of when you activate it. If you wish the emails to go out at a particular time in the future, set the Next Fire Time to a future date or time. (If you have configured the Frequency to Nightly or another recurring value, the system will reset the Next Fire Time automatically after it runs each time.)

Configure which Report and Notification to use

Next, you need to tell the job which report and which notification to use to send out the emails. Do this from the Site Job Settings option under the three-dots menu:

image-20240314111828359

On the settings grid screen, make sure the setting values for the "reportCode" and "notificationCode" settings are set to the report and notification you want to use:

image-20240314112054038

With these values in place, you can then go back to the main Site Job screen, and activate the job to have it run automatically. In addition you can choose Run Job ... from the three-dots menu to the run job manually and send out the emails.

Option to reuse a notification for multiple follow ups

By default the system will skip sending an email if it sees that the follow-up notification was previously sent for the order. You can override this, however, which can be useful if you need to send the same notification periodically to the same customers. To override this setting, add another Site Job Setting whose code is 'sendOnlyOncePerOrder' and with a Boolean Value of 0 (ie false):

image-20240329153125118

Note: if you do not add this setting, it will default to true. In other words it will only ever send the same follow up notification once per order.

5. View the email messages that are produced by the job.

After the job runs, you can view all of the email messages that it produced by visiting the Notifications -> Email Messages screen. You can filter by the subject field or other fields to find the emails produced by the job.

Note: it's not a bad idea to test this whole process by adding filters to the report that limit the number of emails that are sent out, or using the report's Size field to limit it. Once you are comfortable with the emails that are generate, you can then expand the report's criteria to include everyone you want to include.

How To Create Additional Follow Up Email Jobs, Including Based on Order Items

The above example uses a report based on orders to generate the recipients for the follow up emails, but you can also use reports based on the items that were ordered. This can offer some more flexible ways to build the list of orders that are sent each follow up email. In the below example, we are basing the list on the category the items that were ordered are in. This will also serve to demostrate how to create additional, separate follow up email jobs.

1. Creating an OrderItem report for a new follow up email

Navigate to Ecommerce -> Orders -> Order Items and use the filters to limit the order items shown to those that match the customers you wish to target. In this example, using the Additional Filters (RSQL) field, we have limited the list to order items whose products are in a specific category:

image-20250327101657462

This is done with the expression,

product.category.code==american_made_holidday_products

To limit it to just one product you can also use Add New Filter, and select "Product Code" from the list.

Once you are satisfied with the filters and the criteria you have defined, create a new Report from the screen, following the steps described above in the "Create a report from the filtered grid screen you've set up." section.

Note: The Order Items report may list multiple items from the same order. However, when the follow up job runs, it will automatically limit it to just one email per order.

2. Create a new Site Job, Notification, and Template for follow up emails

It's likely you'll need to have more than one follow up job if you wish to target specific customers more precisely. For each Report that specifies a specific set of orders/order items, you can set up a separate Site Job, Notification, and Template to use to generate the emails.

  • Site Job: this defines when the emails should be sent out. In the Site Job Settings, you'll define which Report to use to pull the list of orders, and which Notification to use for the emails.

  • Notification: this defines who the emails are sent to. Typically, it will be the order's billing email or delivery email. In addition, you can add CCs or BCCs. You can also override the email subject and add a prefix to the body of the emails, which makes it easier to reuse Templates.

  • Template: this defines the content of the emails, including the subject and the body of the email.

Create a new Template for follow up emails

Navigate to Notifications and Emails -> Templates, and click the plus icon to create a new template. You can use the existing OrderFollowUpJobNotification template as an example for the template you create for each new type of email. Refer to the Notification Features doc for more information. In the template's body, you can add content specific to the products/categories you are targeting. Templates are written using the Velocity template syntax.

Create a new Notification for follow up emails

After creating the template, navigate to Notifications and Emails -> Notifications and click the plus icon there to create a new Notification record. Assign your new template to the notification. Define the Tos, CCs, and BCCs fields. Typically the Tos field uses the order's delivery or billing email. For example: ${order.deliveryEmail1}. You can use the existing OrderFollowUpJobNotification notification as an example for your new notification. Refer to the Notification Features doc for more information.

Create a new Site Job for follow up emails

Under Operations -> Site Functions and Jobs -> Site Jobs, click the plus icon to create a new Site Job. You can use the existing Order Follow Job as an example for your new Site Job. Here, you can define when the Site Job should run. By default the job's Is Active flag is off. We suggest you keep it off until you've finished configuring it with the below steps.

For more information on how to set up the Site Job, including configuring which Notification and Report to use, refer to the above section on "Configure the follow up job with the report and the notification you would like to use."

Opting Out of Order Follow Up Notifications

Generally speaking, follow up emails related to an order the customer placed with you are not considered spam, because there is an existing business relationship between the sender and the recipient. Nevertheless, It's a good idea to provide a way for your customers to opt out of receiving the notification repeatedly.

Note: This pertains to notifications that are reused for multiple follow up emails for the same order, ie, where there is a site job setting with a code of "sendOnlyOncePerOrder" set to false (see above). If the customer opts out of a given notification and order, and they place another order later, they must opt out again for the new order. In addition, if more than one type of notification is sent out for the same order, they must opt out of each notification separately.

The default OrderFollowUpNotification template that the system comes with has a link at the bottom for the customer to opt out of receiving the notification again for the same order. If you create a different template for your order follow up emails, you use the same link format:

<a href="https://softslate.com/orderNotificationOptOut/${order.orderNumber}/${order.syncCode}?notification=${notification.syncCode}">Opt Out</a>

When a customer clicks the link that is generated from this template code, the order setting described below will get added to their order, and it will be excluded from being sent the same notification again. The customer will be taken to your site and shown a success message indicating they were successfully opted out.

How To Manually Mark an Order As Opted Out From a Given Follow Up Email

  1. Find the customer's order, and under the three-dots menu, click "Order Settings" to add a new order setting indicating that they have opted out of a particular follow up email:

image-202403211133206252. Click the plus icon to add a new Order Setting under the order and enter the following values for the fields.

image-20240321113657587

  1. For the setting's code and name, enter the code of the notification record that they are opting out of, followed by "-OptedOut". For example if you are using the default "OrderFollowUpJobNotification" notification, enter "OrderFollowUpJobNotification-OptedOut" for the code and name of the setting.

  2. For the setting's Setting Type, use "PRIVATE". (This means the customer will never see the setting or its value.)

  3. For the Setting Value, enter 1.

  4. Click Add New Record.