2
  • I have a content type: event
  • It has a single date field: date
  • It has a flag on it: reminder

When the user flags the node, I want to schedule a rule to send them an email the day of the event.

Can someone walk me through the steps on how to do this?

Edit: I have now gotten as far as being able to schedule the email

This is what I have so far.

Add new component - Type: Action set - Name: Send reminder email - Data Type: User - Data Type: Node

Add action - Send reminder mail - To: 'user:mail' - Subject: Don't forget about [node:title] - Body: - Don't forget about [node:title] tomorrow!

Create new Rule - Name: Schedule reminder email - React on Event: A node has been flagged, under "Remind"

Condition: Entity has field Data Selector flagged-node Field: Date

Action: Schedule component evaluation Action set: Send reminder email

  • I "think" that anything starting from your "edit" is actually an answer to your question (I can't find anything wrong or missing in it). Therefor I think you should MOVE everything from that "Edit:" (to the end of your question) to an actual answer, so that you can also mark it as "accepted" later on (and so that this question no longer shows up in the list of unanswered questions). If you agree, and after you performed such move, please let me know via an extra comment here. BTW: the answer that you granted the bounty to has broken links ... – Pierre.Vriens Sep 7 '16 at 8:48
2
+50

Sounds like you know how to set up the Flag. Triggering a Rule with Flag is piece of cake and NodeOne has an create 15min tutorial covering all the details. They also have all the needed training on Rules if your fuzzy about Rules in general. Once your ready to set up your rule and you have the event to trigger it, you can set up the email action following a recipe similar to this other answer. In your case you have the future event. Lullabot has a tutorial specifically on the Rules Scheduler.

  • woohah! my first bounty! :D thanks and good luck with your project. – Tom Jun 7 '13 at 7:16
  • This answer has 2 broken links, can you fix them? – Pierre.Vriens Sep 7 '16 at 8:51
0

Problem with this kind of rules setup is finding event when the action will take place. Rules scheduler has been talked on drupal.org & there are some bit of documentation at https://drupal.org/node/517674. It may help you.

There are other option to do it by help of your own module by implementing hook_cron to fire e-mail on such condition which will be met by DB query condition given by you.

  • I would love to know the reason of negative vote.. – RajeevK Jun 1 '13 at 13:15
  • You mention "Problem with this kind of rules setup is finding event when the action will take place.". As mentioned I have a flag on the node. This will trigger the event to schedule the action. – Nigel Waters Jun 6 '13 at 0:18
  • @NigelWaters - May be you have edited the question but when I answered, you wanted to set rules to send email on the day of the event to those user who has registered to any event. Anyway the thing which you are suppose to do is not hard as per my knowledge but I won't take chance answering again for negative vote..may be your requirement changes again... – RajeevK Jun 6 '13 at 3:54
  • 1
    @Pierre.Vriens Or one more possible reason is "He was looking for someone else to complete his task". If you look into the revisions of this question, you would find it as altogether a different question. There was this link drupal.stackexchange.com/questions/64695/… as question & which he later changed. And then voted my answer negative.. Anyway, doesn't matter anymore.. – RajeevK Feb 11 '17 at 7:05
  • 1
    @Pierre.Vriens Actually I could have even helped him in providing code for similar task as I was working on a complex Drupal Commerce project with many similar feature that time. I understood his issue in first instance & knew that Cron or Schedular can solve this. As you know, Rules set works on any trigger based on any user action (which he did do by having REMINDER flag). But instead of understanding the logic, he downvoted. Thanks for upvote :) – RajeevK Feb 11 '17 at 7:15
-1

You can add flag on your node called "reminder users" to send bulk emails. create rule on that flag so that rule will run once the flag update. in rules action. fetch users who flagged this node for attending this event. next create a loop to add users emails into your list and use send HTML e-mail into same loop to send email to all users who flagged this node.

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.