Posted by raslee on January 3, 2012 at 12:28pm
Hi everybody,
I hope you can give me a little guidance out in the world of Rules.
I would like to be able to send out individual emails to the users of my webpage. Each user will type in the date of his birth on his profile, and I would like for him to receive a mail not just on his birthday but also on other dates set by me. The mail will consist of a standard message determined by the amount of time since his birth. I could be a mail saying: “Today its 10.000 days since you were born – maby its time to go see a dentist”.
So is this possible with Rules? Do I need other modules? Any good advice on how I set this up?
Thank you so much!
raslee
Comments
Rules Scheduler
This is an excellent task for Rules Scheduler! It is included in the Rules project, and even if it is a bit tricky to get started with it is definitely worth it. Some introduction videos can be found at http://dev.nodeone.se/en/introducing-rules-scheduler (and the following two episodes in the series).
Good luck!
//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 250+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding. Creative Commons license!
How will Rules find the right information
Hey Johan,
Thanks a lot for your help.
I’m having trouble understanding how I get my rule to trigger an action (sending a mail) as a result of the date put in by my user – note that the dates will all be different.
At the same time I’m not sure how to get Rules to find the e-mail address put in by my user.
Hope you have the time to send me on the right way!
Thanks again.
raslee
Sorry, I have no better
Sorry, I have no better answer to this than the ones I have already recorded in screencasts – the series on Rules covers this in pretty much detail. :-/
In short:
* Add date fields to the user accounts
* On save of user accounts, have a reaction rule schedule the execution of Rules components sending out e-mails to the user in question
* If you want the e-mails repeated, have the corresponding components re-schedule themselves as an action last in the components
I hope this helps to get on the right way. Good luck!
//Johan Falk
Thanks again - working on it
Hey Johan,
Thanks again.
I've been working a bit on it the last couple of days. Not quit there yet, but I'm starting to see how Rules works. Can't quit figure out how to get my rule to read the date from the user profile, but will work something out. I will take a closer look at you very fine tutorials at node one.
/raslee
One problem left
Hi again,
I think I am getting the hang of it, great tutorials, Johan.
One thing, that I can't seem to get right.
Thing is, I have added a datefield to the userprofiles. When users create a profile they fill out the field with lets say their birthdate. I want Rules to send out mails as a reaction to that date, but instead it reacts on the date where the datefield is filled out.
Example: The Rule is set to send out a mail 100 days after the date in the datefield. I will type in the date 20.01.12, but instead of sending me a mail 100 days after the chosen date, I will get a mail tomorrow, one day after I have put a date in the datefield.
My rules isn't reading/reacting on the date in the datefield.
Hope someone can help on my way,
Thanks guys.
What is the input?
What do you set the evaluation time to? (Are you using the date field to set it?)
Hi
The Scheduled evaluation date is set with the data selector and set to: "account:field-dato:0" wich is the name of the field.
Is that waht you mean - evaluation time?
The event is set as: After
The event is set as: After saving a new uesr account and After updating an excisting user account
Elemnt: Entity has field: #and the dato field i've added to the user accounts.
Action: Schedule component evaluation - wich is set to send out a mail and scheduled evaluation date: [account:field-dato:0]
The variables is set as 'user': account and 'date': account:field-dato:0 - do I miss something here?!
Data selector
That's strange.
If you're using direct input, try switching to data selection. I'm not sure that token replacement patterns pick up multiple-value fields (which this appears to be). If this doesn't work, try changing the date field to another type. I'm not certain that Rules can read all three date field types (but don't remember which one works).
Good luck,
//Johan Falk
"If you're using direct
"If you're using direct input, try switching to data selection" do you mean any where specific or just in general - in all fields possible?
I've tried changing the date fields without any luck...
Sorry but all the questions - Ill buy you a beer if you ever get to Copenhagen!