> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/mass-mailing/further-reading/affiliate-and-member-email-opt-out-and-opt-in.md).

# Affiliate and Member Email Opt-out and Opt-in

*Article Topics:* [*Emails*](/getting-started/common-topics/emails.md)*,* [*Affiliates*](/getting-started/common-topics/affiliates.md)*,* [*Members*](/getting-started/common-topics/members.md)

NATS provides a built-in way for both affiliates and members to manage their email preferences and opt out of receiving automated mass mailings.

## Affiliate Email Opt-out

Affiliates can manually choose not to receive automated emails sent by the NATS Mailer.

1. Have the affiliate log in to the affiliate portal.
2. Navigate to the **Display Defaults** tab in the Affiliate Area.
3. Go to the **Main Display Defaults** section.
4. Toggle the **Receive Mailings** setting to disable automated emails.

Once disabled, emails will only be sent to affiliates that have not opted out of automated emails.

## Member Email Opt-in Checkbox

Your members can also opt in or out of receiving automated emails from the Mailing Admin.

To add an opt-in checkbox to your join template:

1. Open your [join form template](/nats-admin/sites/common-questions/customizing-your-join-form.md).
2. Insert the following HTML checkbox code:
   1. <pre data-overflow="wrap"><code>&#x3C;input type="checkbox" name "signup[mailok]" value=1 checked>
      </code></pre>

When checked, the member's account will be saved with permission to receive automated mailings. If left unchecked, the member will automatically opt out.

{% hint style="warning" %}
**Important:** Once these settings are configured, NATS will only send automated emails to members who have not opted out.&#x20;
{% endhint %}

## Adding Unsubscribe and Opt-out Links

{% hint style="info" %}
Please note: For the following example, replace linkdomain with your [domain](/using-nats/nats-admin-features/linkdomain.md).
{% endhint %}

#### Affiliate Opt-out

For affiliates to be able to opt out of emails, you need to provide them with a link similar to the following:

{% code overflow="wrap" %}

```
https://linkdomain/unsubscribe.php?userid={$loginid}&email={$email}
```

{% endcode %}

If you would like to generate a custom unsubscribe link per affiliate using HTML, you can add this code to the bottom of the page, changing "Unsubscribe" to whichever text you wish to display:

{% code overflow="wrap" %}

```
<a href="http://linkdomain/unsubscribe.php?userid={$loginid}&email={$email}">Unsubscribe</a>
```

{% endcode %}

#### Member Opt-out

For members to be able to opt out of emails, you need to provide them with a link similar to the following:

{% code overflow="wrap" %}

```
https://linkdomain/unsubscribe.php?memberid={$memberid}&email={$email}
```

{% endcode %}

## Related Articles

{% content-ref url="/pages/eMDHRXiddWiyCiuytsYa" %}
[Mailing Management](/nats-admin/mass-mailing/mailing-management.md)
{% endcontent-ref %}

{% content-ref url="/pages/Re5VgnlvWvWStron3wGY" %}
[Customizing your Join Form](/nats-admin/sites/common-questions/customizing-your-join-form.md)
{% endcontent-ref %}
