0

I am trying to set up a rule that will send me a mail when a node will expire the next day. and of corse the rule must be executed every day in order to work.

So I have a content type 'event' with the field 'end date' When the current date is one day earlier to the field data 'end date' I want to receive a mail : 'the event [node:url] will end tomorrow'

Thanks for your help and excuse my english.

Stephan Muller
  • 27,018
  • 16
  • 85
  • 126
steph1301
  • 47
  • 1
  • 6

1 Answers1

1

Best way to do this without using Cron is to schedule the email to be sent when you save that content type.

So, basically, you add a new rule triggered when content of that content type is saved which schedules the email to be sent the day before the "end date".

UPDATE (adding overall steps on how to achieve this):

  1. Go to Configuration > Workflow > Rules > Components and add a new component of Action Set type; configure a variable on that action set to be the Event content type you want so you get the full details about the event there so you can embed the URL on the email and all that
  2. Go to Configuration > Workflow > Rules and add a new rule
  3. Choose the trigger to be "After saving new content" and then add a condition to check for the right content type ("Content is of type")
  4. Add an action to "Schedule component evaluation", pick the Component you created and configure it to run on the event date - 1 day (switch to data selection, pick the field with the end date and add a negative offset of -1 day
  5. Configure the Event you want to pass as a parameter so the Component gets the right event and can use it on the email

That's it, you should be all set.

Alberto
  • 880
  • 5
  • 15
  • This sounds good. Thanks for answering. First I was trying to make somehing like that but I was not able to do so. If you could just give me a little information about how to make it, it will be great. – steph1301 Jul 07 '14 at 05:19
  • Hey steph1301.. updated the answer with the overall steps. Hope it helps.. if it does would be great if you could tick the answer as correct. – Alberto Jul 09 '14 at 17:10
  • Thank you very mush. Hope this will also help others because it really helped me. – steph1301 Aug 07 '14 at 05:31