Advanced time delaying for your actions
There may be a situation when you need to delay an action for a specific time, like to schedule it for a special sale date, or just prevent customers' mailboxes from overflowing with your messages by slightly delaying them from the moment an event occurs. This is where add-on ShopMagic Delayed Actions comes in handy.
How to postpone your actions?
After plugin activation, your automations will now have additional checkbox in action configuration - Enable delay. This is the only configuration you need for delaying actions. Additionally, each of your action is postponed on its own configuration, so you can mix multiple actions with delay for one automation, e.g. a series of payment reminder deferred for one hour, week and two weeks with rechecking order status before running action.
Available types of delay
ShopMagic Delayed Actions introduces 4 different types of deferring:
- Simple time delay
- Run on a fixed date
- Schedule with time
- Delay with placeholder
In addition to that, you can prevent your emails from sending e.g. in weekends by selecting Active days.
Simple time delay
When you just want to suspend your action for specified number of time, e.g. 2 hours since a new order made, this setting is the best solution. You can select to delay your action by specified number of:
- minutes
- hours
- days
- weeks
Run on a fixed date
When you are going to start a special sale starting next Friday at 5 o'clock, there's no better possibility than scheduling your action for a specific date. You can plan ahead, when your actions are needed to run and don't bother anymore. All automations occurring before the date of schedule will be queued.
Schedule with time
There are moments when you don't have any specific date in mind, but you'd rather not to email your customer in the middle of the night. With selecting time of delay, you can ensure, automations are executed no more than once a day on the selected hour.
This setting plays nicely with the Active days setting, allowing you to configure action execution no often than once a week. Selecting only one active day will schedule your actions for the next selected day.
Delay with placeholder
Delaying with placeholders is possibly the most powerful setting for special use cases, thanks to the underlying mechanism of PHP language. Our date related placeholders can be referenced here with specific time modification, basing on PHP documentation for relative date formats.
Placeholders, you can use in these settings:
{{ order.date_created }}
{{ order.date_completed }}
{{ order.date_paid }}
{{ membership.expires_date }}
{{ membership.started_date }}
{{ subscriptions.end_date }}
{{ subscriptions.last_payment_date }}
{{ subscriptions.next_payment_date }}
{{ subscriptions.start_date }}
{{ subscriptions.trial_end_date }}
{{ booking.end_date }}
{{ booking.start_date }}
Advanced usage of placeholders for delay
Besides above placeholders you can also rely on any meta fields stored with your order, product or subscription, etc. (with correct usage i.e. no subscription data is stored in order based event). An only requirement is that the placeholder returns date parsable by PHP DateTime
class constructor, according to PHP supported date and time formats. This enables you a world of possibilities, as your meta field can contain values such as first day of next month or similar complex formats.
Save the day with active days setting
Each of your delay can be configured further with addition of active days checkboxes: you can select which days are available for executing an action. The way it works is simple - if your schedule would be set for any day that falls into not checked days, it will be rescheduled for the first available day. In such case, if you've checked time delay for 2 hours, but the automation is executed on Saturday (which is disabled at your current settings), the action will be planned for Monday (next available).
With the selection of specified days, you can create such configurations as sending emails with coupons to your customers only on business days.
How to check scheduled actions?
All delayed actions are put into the queue, which you can find in your admin area (ShopMagic → Queue). Queue has info about the name of scheduled action and the time of execution. Additionally, you are able to cancel any action from the queue, if you don't want to run it.
When the scheduled time comes, the action will be executed, and you will be able to see its outcome in another tab - ShopMagic → Outcomes.