Using Rules to Send Multiple "Expiring Soon" Emails
Submitted by Leighton Whiting on Thu, 07/15/2010 - 14:40
This tutorial showcases some of the new Membership Suite Rules Integration features by explaining how to use Rules to schedule and send multiple 'Expiring Soon' emails. Enjoy!
This tutorial has been very useful, not only for setting up a schedule as shown, but also to understand how to use rulesets in general.
I have a recurring membership with annual payments set to expire after 3 years and have successfully set up a reminder message before each payment becomes due using a condition to select the correct plan.
I have been looking at a way to cancel the scheduled rules if the membership is cancelled. This is what I have done (with no success) so far...
Created another ruleset with 2 actions to 'Delete scheduled rulesets' with the same identifiers as the reminder message ruleset actions.
Created a rule to trigger the ruleset on event 'Membership is cancelled' with a condition to select the correct plan.
Unfortunately the second ruleset and trigger do not work.
I am not sure if this is a problem with Rules or if I am doing it wrong - any thoughts on this would be welcome. I don't want users to get a reminder if their membership has been cancelled!
Submitted by Leighton Whiting on Wed, 12/01/2010 - 14:36.
You should be able to create a new Triggered Rule that will delete the scheduled rule set when the membership is canceled, by providing the same identification as you did when you set it up (including the tokens).
You wouldn't need to create a new rule set for canceling, just a new triggered rule.
After Leighton helped me out I now have this working. For anyone else doing something similar here is the process...
To cancel a scheduled rule set when (for example) a membership is cancelled...
Create a new rule triggered by the 'Membership cancelled' event
Give it the action 'Delete scheduled tasks'
Important! The identifier for the action must exactly match the identifier for the task to be cancelled and the ruleset must also be the same
Give the rule a label to identify it in your list of triggered rules
So in my case, when a user signs up for a 3 year recurring membership, they get a reminder when the 2nd and 3rd payments are due. If the membership is cancelled, the scheduled reminders are also cancelled. The membership expiry date will be re-set automatically by the MS module and the user will get the default expiry message from the plan settings when the plan is near its end.
This really does demonstrate the power of the Rules module and the way Membership Suite exposes its functions to it. The support Leighton has given on this has been superb (he even sent me a video of how to do it!) and it has helped me understand Rules - which does have a steep learning curve.
Thank you Leighton so much creating this tutorial, your hard work appreciated! This tutorial (among the others) is helping a lot to enjoy the full power of MoneyScripts features. Keep up the great work!
Comments
Cancelling a scheduled rule
This tutorial has been very useful, not only for setting up a schedule as shown, but also to understand how to use rulesets in general.
I have a recurring membership with annual payments set to expire after 3 years and have successfully set up a reminder message before each payment becomes due using a condition to select the correct plan.
I have been looking at a way to cancel the scheduled rules if the membership is cancelled. This is what I have done (with no success) so far...
Created another ruleset with 2 actions to 'Delete scheduled rulesets' with the same identifiers as the reminder message ruleset actions.
Created a rule to trigger the ruleset on event 'Membership is cancelled' with a condition to select the correct plan.
Unfortunately the second ruleset and trigger do not work.
I have also tried the method described at the end of http://groups.drupal.org/node/22517 but could not get that to work either.
I am not sure if this is a problem with Rules or if I am doing it wrong - any thoughts on this would be welcome. I don't want users to get a reminder if their membership has been cancelled!
You should be able to
You should be able to create a new Triggered Rule that will delete the scheduled rule set when the membership is canceled, by providing the same identification as you did when you set it up (including the tokens).
You wouldn't need to create a new rule set for canceling, just a new triggered rule.
Sincerely,
Leighton Whiting
Update on how to do this
After Leighton helped me out I now have this working. For anyone else doing something similar here is the process...
To cancel a scheduled rule set when (for example) a membership is cancelled...
So in my case, when a user signs up for a 3 year recurring membership, they get a reminder when the 2nd and 3rd payments are due. If the membership is cancelled, the scheduled reminders are also cancelled. The membership expiry date will be re-set automatically by the MS module and the user will get the default expiry message from the plan settings when the plan is near its end.
This really does demonstrate the power of the Rules module and the way Membership Suite exposes its functions to it. The support Leighton has given on this has been superb (he even sent me a video of how to do it!) and it has helped me understand Rules - which does have a steep learning curve.
Thank you Leighton so much
Thank you Leighton so much creating this tutorial, your hard work appreciated! This tutorial (among the others) is helping a lot to enjoy the full power of MoneyScripts features. Keep up the great work!