Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

The accepted answer to this question is indeed a solution for the question asked. Whereas a condensed version of the question is like "How to send an eMail after some predefined time after the creation of a node, provided some boolean is (still) true the moment that eMail should e triggered?".

I think you're making it too complicated by what you're asking for. To explain what I mean, first have a look at my answer to the question "http"https://drupal.stackexchange.com/questions/166809/how-can-i-set-a-reminder-for-a-specific-user-to-be-triggered-on-a-specific-date/166883#166883". Obviously, that is not the same question as yours here. But the "specific date" there corresponds to your "predefined time after the node creation date".

With that, you could avoid that (not obvious to implement) validation if you'd just trigger another rule each time that the node is edited, and then verify the relevant data of your node content to decide if you need to do either of these:

  • no more need to send the eMail "later on", so just DELETE the scheduled execution of the Rule to send your eMail.
  • (re-)schedule the execution of the Rule to send your eMail.

Apart from the simplification of the Rules logic with this approach, you also get the advantage that the "queue" of actually scheduled eMails is always accurate (the scheduled rules correspond to nodes that have a current status that indicates that the eMail is still relevant). While with your current implementation (to validate again at the time the eMail is due), you may have zillions of scheduled rules that are sitting there, while at the very last minute it turns out many of them were just waiting to do .... nothing.

Bottomline: sometimes the solution for a problem is ... to avoid the problem from happening.

The accepted answer to this question is indeed a solution for the question asked. Whereas a condensed version of the question is like "How to send an eMail after some predefined time after the creation of a node, provided some boolean is (still) true the moment that eMail should e triggered?".

I think you're making it too complicated by what you're asking for. To explain what I mean, first have a look at my answer to the question "http://drupal.stackexchange.com/questions/166809/how-can-i-set-a-reminder-for-a-specific-user-to-be-triggered-on-a-specific-date/166883#166883". Obviously, that is not the same question as yours here. But the "specific date" there corresponds to your "predefined time after the node creation date".

With that, you could avoid that (not obvious to implement) validation if you'd just trigger another rule each time that the node is edited, and then verify the relevant data of your node content to decide if you need to do either of these:

  • no more need to send the eMail "later on", so just DELETE the scheduled execution of the Rule to send your eMail.
  • (re-)schedule the execution of the Rule to send your eMail.

Apart from the simplification of the Rules logic with this approach, you also get the advantage that the "queue" of actually scheduled eMails is always accurate (the scheduled rules correspond to nodes that have a current status that indicates that the eMail is still relevant). While with your current implementation (to validate again at the time the eMail is due), you may have zillions of scheduled rules that are sitting there, while at the very last minute it turns out many of them were just waiting to do .... nothing.

Bottomline: sometimes the solution for a problem is ... to avoid the problem from happening.

The accepted answer to this question is indeed a solution for the question asked. Whereas a condensed version of the question is like "How to send an eMail after some predefined time after the creation of a node, provided some boolean is (still) true the moment that eMail should e triggered?".

I think you're making it too complicated by what you're asking for. To explain what I mean, first have a look at my answer to the question "https://drupal.stackexchange.com/questions/166809/how-can-i-set-a-reminder-for-a-specific-user-to-be-triggered-on-a-specific-date/166883#166883". Obviously, that is not the same question as yours here. But the "specific date" there corresponds to your "predefined time after the node creation date".

With that, you could avoid that (not obvious to implement) validation if you'd just trigger another rule each time that the node is edited, and then verify the relevant data of your node content to decide if you need to do either of these:

  • no more need to send the eMail "later on", so just DELETE the scheduled execution of the Rule to send your eMail.
  • (re-)schedule the execution of the Rule to send your eMail.

Apart from the simplification of the Rules logic with this approach, you also get the advantage that the "queue" of actually scheduled eMails is always accurate (the scheduled rules correspond to nodes that have a current status that indicates that the eMail is still relevant). While with your current implementation (to validate again at the time the eMail is due), you may have zillions of scheduled rules that are sitting there, while at the very last minute it turns out many of them were just waiting to do .... nothing.

Bottomline: sometimes the solution for a problem is ... to avoid the problem from happening.

Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

The accepted answer to this question is indeed a solution for the question asked. Whereas a condensed version of the question is like "How to send an eMail after some predefined time after the creation of a node, provided some boolean is (still) true the moment that eMail should e triggered?".

I think you're making it too complicated by what you're asking for. To explain what I mean, first have a look at my answer to the question "http://drupal.stackexchange.com/questions/166809/how-can-i-set-a-reminder-for-a-specific-user-to-be-triggered-on-a-specific-date/166883#166883". Obviously, that is not the same question as yours here. But the "specific date" there corresponds to your "predefined time after the node creation date".

With that, you could avoid that (not obvious to implement) validation if you'd just trigger another rule each time that the node is edited, and then verify the relevant data of your node content to decide if you need to do either of these:

  • no more need to send the eMail "later on", so just DELETE the scheduled execution of the Rule to send your eMail.
  • (re-)schedule the execution of the Rule to send your eMail.

Apart from the simplification of the Rules logic with this approach, you also get the advantage that the "queue" of actually scheduled eMails is always accurate (the scheduled rules correspond to nodes that have a current status that indicates that the eMail is still relevant). While with your current implementation (to validate again at the time the eMail is due), you may have zillions of scheduled rules that are sitting there, while at the very last minute it turns out many of them were just waiting to do .... nothing.

Bottomline: sometimes the solution for a problem is ... to avoid the problem from happening.