1. Home
  2. Custom Order Status for WooCommerce
  3. Sending Email Notification for Custom Order Status

Sending Email Notification for Custom Order Status

In the previous post we discussed how to create new custom order statuses using Custom Order Status for WooCommerce Pro plugin. Once the custom statuses have been created, you can setup emails that will be triggered when an order status changes to custom status. Email notification is sent to the customer and/or admin for confirming them about the order status change.

Sending Email Notifications

These email notifications can be set under WooCommerce -> Settings -> Custom Order Status -> Emails.

Default settings for Email section is displayed as shown below:

Default Emails Options section

On this page there are 2 sections, Email Options and Reset Settings.

Email Options

These settings are required for sending email notification when an order status changes to selected custom status.

Let us understand each of these settings in detail:

1. Emails: Tick this checkbox to enable sending email notifications for custom statuses.

2. Statuses: Here there is a dropdown of custom order statuses. Select one or more statuses for which this email notification will be sent. If you leave it blank, then emails will be sent for all custom order statuses.

3. Email address: Email notifications can be sent to customers and/or admin. For customers, enter %customer% in the field and this email notification will be sent to the customer’s billing email. Similarly, enter %admin% in the field and the email notification will be sent to the admin’s email address. If you leave this blank, the email will be sent to the admin.

4. Email subject: You can enter the subject of the email here. There are list of shortcodes to be used which will be replaced by the actual values in the email. Shortcodes like {order_id}, {order_number}, {order_date}, {site_title}, {status_to} etc are available that can be used for the email subject.

5. Email heading: The text entered in this field will be displayed as a heading of the email. For email heading as well, you can use these shortcodes which will get replaced by the actual values. Heading should be self explanatory and easily understandable by the customer/admin.

6. Email content: You can enter the details here which you wish to highlight in the email notification sent to the customer/admin using shortcodes. It can contain order details, order status, changed status, date and time etc.

Reset Settings

This setting is used to reset the Email Options settings to the default values. You can reset these settings by ticking the Reset section settings checkbox and clicking the Save changes button.

Now that we are aware of what each setting does, lets consider an instance to understand the process of sending email notifications in depth.

Example

Say we create a new order #2310 whose current status is Processing and add a new custom order status – Dispatched. When the current status of this order changes to custom status Dispatched, an email notification should be sent to the admin notifying him about this change.

Orders page displays the details of order #2310 along with Dispatched icon under Actions column as shown below:

New order created

Now let us add settings under Emails section so that when status of this order changes from Processing to custom status – Dispatched, an email notification is sent to the admin. Therefore go to Emails page and add the settings as shown below:

Add settings for sending email notification

As you can see above, Enable section has been ticked. Hence an email notification will be sent when the status change will take place for this order. Now select Statuses as Dispatched from the custom order status dropdown because we want this email notification to be sent out when the status changes to Dispatched.

Statuses selected as Dispatched

Now enter email address as %admin% because you want to send the email notification to admin’s email address.

Add email subject as [{site_title}] Order #{order_number} status changed to {status_to} – {order_date} using the available shortcodes. This will display the subject on the admin’s side as [WordPress] Order #2310 status changed to dispatched – November 26, 2018.

Moreover, the heading and the contents of this email entered using the shortcodes are Order status changed to {status_to} and Order #{order_number} status changed from {status_from} to {status_to} respectively. Therefore the email heading will read as Order status changed to dispatched and the contents of the email will show message as Order #2310 status changed from processing to dispatched as shown below:

Email notification sent to admin

Conclusion

This post elaborates on the process of composing and sending email notification when an order status changes to a custom order status. Its the most critical section as you can notify the customers/admin of their order status change by enabling the settings in this section. There are many other settings which are equally important so that this plugin can be of utmost use to the owner which we will discuss in our next post.

Was this article helpful to you? Yes No

How can we help?