> For the complete documentation index, see [llms.txt](https://help.orderdesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.orderdesk.com/integration-setup-guides/tools-and-productivity/how-to-add-users-to-a-mailing-list-dynamically.md).

# 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*.

![](/files/TunbsLwsLpN5j4olIKXA)

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.

### Related Articles

* [Mailchimp Integration](/integration-setup-guides/crm-tools/mailchimp-integration.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.orderdesk.com/integration-setup-guides/tools-and-productivity/how-to-add-users-to-a-mailing-list-dynamically.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
