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

![](https://251457507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQOLMUJWMYtrpQ7Oxxca%2Fuploads%2FNvrtlOVqzRAnMwrlZppQ%2Flegacy-4ada11a3caeb389ff750.png?alt=media)

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
