Frage

Is there a way for the user to opt in/out of receiving an email upon the triggering of a rule?

I have a rule to send an email to the author of a node any time a new node is created which references it. This is done in the following way;

ON event After saving new content IF Created content is published

DO actionLoad a referenced node actionLoad the Referenced content author actionSend a mail to a user

Unfortunately the author of the node has no way to opt out of receiving the email. Any idea how I can make the sent email conditional upon it being flagged first? Or better still, is there a way I could place a checkbox in the original node creation form where the user can opt in or out of receiving these notifications? Or maybe someone has some other ideas? Another module perhaps...?

War es hilfreich?

Lösung

One solution is to indeed include a new field, a checkbox on the original node which authors can modify to opt in or out of the emails. You can set the field as hidden in the 'Manage Display' tab.

Then, simply edit your rule by adding a condition of type 'Data value is empty' so you can check whether the new checkbox is checked or not. When setting up that new condition, type in 'node:' and then select the new field in the data selector and make sure to check the 'Negate' button if appropriate (based on how you've set up the language on the checkbox: i.e. does checked mean to opt in or opt out by default). If the checkbox says 'Opt in', then a checked value would return false for empty, so you should negate it in the condition.

That should now fire up the rule based on the new field!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top