How to Add Users To a Mailing List Dynamically
Let’s say that you have connected a mailing list integration (MailChimp, Constant Contact, etc.) but you only want to add a user who checked a box on your checkout form. This can be accomplished by using the Rule Builder to create a specialized rule.
Building Your Rule
Find an order where the customer opted in to your newsletter and look in the Checkout Data section in the upper right. Note the Checkout Data field and value that indicates the user wanted to sign up for your newsletter. For the purpose of this demo, we’ll assume that the field was named “Newsletter” and the content was “yes”.
Now click on Tools > Rule Builder and for the Order Rule rule type, select “Order Is Imported” and then click Continue. Click Add a Filter and select “If Checkout Data Field”. The operator should Equals.
In the value field type “Newsletter". This is going to check the Newsletter checkout data field for the content “yes” and return true if it is found. Now in the action box, select “Subscribe to [Your Service] List” and select the appropriate list. Name your rule and save.
To test, create this rule attached to a “Folder Change” event and test by quickly changing a folder.
With most mailing list integrations you can also automate removal of the user from a particular list.