2

I've got a content type with date fields. What I'd like to do is send a reminder e-mail to the post author one week before the value of the date field, with the rules module, or in another way. How would you go about this?

2

Requirements

Rules, Rules UI, Rules Scheduler, Date, and Date API modules

Add date field

Go to your content types Manage Fields and add a field of type Date.

I called mine Deadline, machine name: field_deadline

Create a Rule

Action: After saving new content Type: Article

enter image description here

This is all you have to do for now, will get back to this rule later.

Create a component

Component Plugin: Rule

enter image description here

Component action

  • Add action of Fetch Entity by Property

enter image description here

  • Add action Send Mail

To: [author-email:0]

enter image description here

Edit your Rule now

  • Add action of Schedule component evaluation. In SCHEDULED EVALUATION DATE click on the grey switch to data selection button. (not visible in screenshot since I already click it)

enter image description here


Testing

Go to the components tab and click on schedule

enter image description here

You'll need to click those grey switch to ... buttons to get it to look like mine.

Put a node ID in the last one.

enter image description here


Important

Your e-mail will get sent once the time has been reached, but also once cron runs. So if your cron runs once a day, it may not get sent until the day after, so you may need to adjust your cron to run more often.

You might want to use Ultimate Cron so you can schedule specific crons to run at different intervals, instead of running everything every x minutes, days, hours.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.