When a scheduled date is reached
Sends a notification when a chosen date is reached, optionally offset by a number of days before or after.
Most triggers run on a Craft event. This one does not. Craft fires nothing when an entry's Post Date or Expiry Date passes, so Notifier polls for due notifications instead.
Set up Scheduled Sending
Before this trigger will fire, you will need to run the schedule on a recurring basis.
Configuring the date
Three controls decide when the notification fires:
- Offset - Number of days. Hidden when the direction is "On".
- Direction - Either
On,days before, ordays after. - Date field - The date to measure against.
For example:
OnPost Datefires the moment each entry's post date arrives.15days beforeExpiry Datefires fifteen days before each entry's expiry date.
How it fires
Each notification keeps track of the last time it was run.
When the schedule runs, notifications are sent for all elements whose date occurred since the previous run.
After running, the last runtime is updated, and the cycle repeats. Each element fires exactly once.
Field Conditions
Field conditions restrict the notification based on the element's content, using Craft's native conditions framework. Build a rule set against the element's attributes and field values, and the notification will be sent only when every rule matches.
Must match all conditions
The condition builder evaluates every rule with AND semantics, so each rule must pass for the notification to be sent.
Twig variables
The object variable (and its entry alias) is the Entry whose date was reached.
"{{ entry.title }}" reaches its expiry date in 15 days.Examples
Remind the author before an entry expires
Hi {{ entry.author.firstName }},
"{{ entry.title }}" expires in 15 days. Review it here: {{ entry.cpEditUrl }}Announce an entry the day its post date arrives
"{{ entry.title }}" is now live in {{ entry.section.name }}.Follow up a week after publishing
"{{ entry.title }}" has been live for a week. Time to check how it's performing.