0

I have a multi-step user signup process. When the user creates their account, they are assigned role "A" and are redirected to a Profile2 form with various fields. If they complete and save their Profile2 form, they are assigned role "B" and role "A" is removed from their account.

I need to send an automated reminder email to the new user 5 days after their account was created, if they are still assigned user role "A". The email's purpose would be to remind them to log in and complete their Profile2 form. How can I accomplish that kind of time delay using Rules? If not rules, are there any other modules that would accomplish this?

Thanks!

2

Here is my solution, based on tenken's advice:

  1. I created a Rule COMPONENT with the condition "User has role: Role A" and the action "Send email".

  2. I then created a Rule...

Events: After saving a new user account

Conditions: None

Actions: Schedule component evaluation

In that Action, I chose these options:

Component: the component from step 1
Scheduled evaluation date: account:created
Add offset: 5 days
User > Data Selector: account
1

You can do this with Rules Scheduler, which is apart of Rules. For an in-depth tutorial on how to set this up please see this blog post I didnt write on how to use Rules Scheduler to send emails (lol).

You also need to likely have your drupal cron job properly configured as well.

  • thanks for the link. That is a really fantastic tutorial. It gets me most of the way there, but I am having trouble figuring out how to "send an automated reminder email to the new user 5 days after their account was created, if they are still assigned user role 'A'." In other words, the rule is scheduling the email properly, but I haven't been ale to get the scheduled rule to cancel itself out if the user no longer has role "A" assigned to their account at the date/time their email is scheduled for. Any ideas on how that type of condition can be added to the scheduled rule? – hockey2112 Jun 16 '14 at 22:30
  • not really, I've worked a little with rules but you should be able to pass a User object to your rule. When cron is fired the roles and the email address of the User object(s) should be retrieve and processed. You just need the correct Conditions for your Rule set or component. – tenken Jun 16 '14 at 22:55

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.