> For the complete documentation index, see [llms.txt](https://docs.rafflex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rafflex.io/marketing/sms-and-email/set-up-email-marketing.md).

# Set Up Email Marketing

Connect JustNotify.io, Mailer Lite or Mailer Lite Classic so customers who opt in to your marketing are added to your mailing list automatically.

***

Rafflex connects to your email marketing provider so you do not have to copy customers across by hand. Once it is connected, every customer who opts in to your marketing is sent straight to your provider, and when a customer unsubscribes on your site, your provider is told so they stop receiving your marketing.

You can choose from three providers:

* **justnotify.io** (we recommend this one). Our sister email service, built for competition sites. It also unlocks the **Send Email** tools in your admin panel, so you can email your subscribers about a competition in a couple of clicks. See [Sending an Email with Notify](/marketing/sms-and-email/sending-an-email-with-notify.md).
* **Mailer Lite**, for the current version of MailerLite.
* **Mailer Lite Classic**, for older MailerLite accounts that still use MailerLite Classic.

{% hint style="info" %}
**Using Klaviyo?** Klaviyo has its own fields and its own guide. You can use Klaviyo on its own, or alongside one of the providers above. See [Klaviyo Integration](/marketing/sms-and-email/klaviyo-integration.md).
{% endhint %}

***

### Before you start

You need two things:

1. **An account with your chosen provider.** If you are choosing JustNotify, [sign up at justnotify.io](https://justnotify.io).
2. **An API key from that provider.** An API key is a long code that lets Rafflex talk to your account securely. Each provider shows you how to create or copy one when you sign up, usually in an **Integrations** or **API** area of their dashboard.

{% hint style="warning" %}
**Treat your API key like a password.** Anyone who has it can add people to your mailing list. Only paste it into your Rafflex admin panel, and never share it in an email or a screenshot.
{% endhint %}

***

### Connect your provider

{% stepper %}
{% step %}

### Open the Marketing settings

In your admin panel, click **Settings** in the left-hand menu (under **Content**), then click **Marketing** in the Settings side menu. The page is titled **Marketing & Social**.
{% endstep %}

{% step %}

### Find the Email Marketing section

The first section on the page is **Email Marketing**, described as "Connect the tools you use for signups, list growth, and automations."
{% endstep %}

{% step %}

### Choose your provider

Click the **Email Marketing Provider** dropdown and pick **justnotify.io**, **Mailer Lite** or **Mailer Lite Classic**.

Not sure which MailerLite to pick? Log in to MailerLite and look at your dashboard. If it says **Classic** anywhere, choose **Mailer Lite Classic**. Otherwise, choose **Mailer Lite**.
{% endstep %}

{% step %}

### Paste your API key

Paste the key from your provider into **Email Marketing Provider API Key**. Take care not to copy any extra spaces before or after it.
{% endstep %}

{% step %}

### Save

Scroll to the bottom of the page and click **Save Settings**. You will see the message **Marketing settings saved successfully**.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**That is it.** From now on, customers who opt in are added to your provider automatically. If you chose **justnotify.io**, a **Send Email** button now appears when you edit a competition, and a **Just notify** option appears in the **Bulk actions** menu on your competitions list.
{% endhint %}

***

### What happens once you are connected

#### When a customer opts in

Customers opt in by leaving the marketing box ticked at checkout, ticking it when they create an account, or entering their email address in a newsletter sign up box on your site. The full list is on [Marketing Consent and Unsubscribes](/marketing/sms-and-email/marketing-consent-and-unsubscribes.md).

Each time someone opts in, Rafflex sends them to your provider:

| Provider                | What is sent                                                                                                                                                                |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **justnotify.io**       | The customer's email address.                                                                                                                                               |
| **Mailer Lite**         | The email address, plus these details when the customer has filled them in: first name, last name, town (as city), phone, country, county (as state) and postcode (as ZIP). |
| **Mailer Lite Classic** | The customer's email address.                                                                                                                                               |

#### When a customer unsubscribes

When a customer unsubscribes on your site (or you unsubscribe them from your admin panel), Rafflex tells your provider so they stop receiving your marketing.

{% hint style="warning" %}
**Unsubscribes only travel one way.** If a customer clicks the unsubscribe link at the bottom of one of your marketing emails, your provider stops sending to them, but your Rafflex site is not told. Your provider's own unsubscribe list is always the one that decides who gets your emails, so keep it as your main record.
{% endhint %}

{% hint style="info" %}
**Using Mailer Lite or Mailer Lite Classic?** Now and again, check that customers who unsubscribed on your site are no longer active subscribers in MailerLite. If any still are, unsubscribe them in MailerLite directly. It only takes a moment and keeps your list clean.
{% endhint %}

#### Customers who opted in before you connected

Rafflex only sends opt ins from the moment your provider is connected. Customers who opted in earlier are not copied across automatically.

If you want to bring earlier customers across yourself, be careful about who you include. The customer export in your admin panel lists **everyone** who registered, not only the people who agreed to marketing. See [Marketing Consent and Unsubscribes](/marketing/sms-and-email/marketing-consent-and-unsubscribes.md#importing-customers-into-a-marketing-tool) before you import anyone.

***

### Changing or removing your provider

* **To switch provider**, choose the new one in **Email Marketing Provider**, paste the new provider's API key into **Email Marketing Provider API Key**, and click **Save Settings**. New opt ins go to the new provider from then on. Your existing subscribers stay in the old provider, so export them from there if you want to move them.
* **To disconnect your provider completely**, set **Email Marketing Provider** back to **Select an option**, clear the **Email Marketing Provider API Key** field, and click **Save Settings**.

{% hint style="info" %}
**Do not leave the API key empty while a provider is selected.** If you do, nothing is passed to your provider, but your customers still see the **Email Marketing** card in their account, which suggests their unsubscribe is going somewhere. Either add the key, or set the provider back to **Select an option** as well.
{% endhint %}

***

### Troubleshooting

<details>

<summary>New customers are not appearing in my provider</summary>

* Check that both **Email Marketing Provider** and **Email Marketing Provider API Key** are filled in, and that you clicked **Save Settings**.
* Copy the API key again from your provider and paste it in fresh. A missing character or an extra space is the most common cause.
* Make sure the API key belongs to the same provider you chose in the dropdown. A Mailer Lite key will not work with **Mailer Lite Classic** selected, and the other way round.
* Remember that only customers who opt in are sent. A customer who unticked the marketing box at checkout will not appear.
* If everything looks right and new sign ups still do not arrive, contact Rafflex support.

</details>

<details>

<summary>I cannot see the Send Email button or the Just notify bulk action</summary>

These only appear when **Email Marketing Provider** is set to **justnotify.io** and an API key is saved. If you use Mailer Lite or Klaviyo, you send your campaigns from inside those tools instead.

</details>

***

### Next steps

{% content-ref url="/pages/Zl6B1rDLk2p5272TAYl5" %}
[Sending an Email with Notify](/marketing/sms-and-email/sending-an-email-with-notify.md)
{% endcontent-ref %}

{% content-ref url="/pages/yw7mjLr1sIZRKvtamjr2" %}
[Klaviyo Integration](/marketing/sms-and-email/klaviyo-integration.md)
{% endcontent-ref %}

{% content-ref url="/pages/Q8uz84nr5UFke0yfVviz" %}
[Marketing Consent and Unsubscribes](/marketing/sms-and-email/marketing-consent-and-unsubscribes.md)
{% endcontent-ref %}
