---
title: Integrating email marketing campaigns into sites
related:
  - https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/working-with-email-campaigns.md
  - https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/managing-email-marketing-subscribers.md
  - https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

## Allowing site visitors to subscribe to email campaigns

You can use the following web parts to allow users to subscribe to email campaigns:

- **Newsletter subscription** web part - displays a dialog that allows website visitors to subscribe to newsletters.
- **Custom subscription form** web part - Provides an email campaign subscription form similar to the the _Subscription_ web part. You can, however, set up this web part to use a different layout and appearance.

  **To be able to modify the web part's layout and appearance**

   You need to define the customized subscription form as an [alternative form](https://docs.kentico.com/k9/configuring-kentico/creating-alternative-forms.md):

  1. Open the **Modules** application.
  2. **Edit** () the **Email marketing** module.
  3. Select the **Classes** tab and edit the **Newsletter - Subscriber** class.
  4. Create the form on the **Alternative forms** tab.
- **My subscriptions** web part - users can use this web part to add or remove their newsletter subscriptions.
- **My account** web part - you can configure this web part to display email campaign subscriptions. Users can then add or remove their subscriptions.

## Subscribing contacts to email campaigns via Marketing automation

You can use the **Newsletter** **subscription** [marketing automation](https://docs.kentico.com/k9/on-line-marketing-features/marketing-automation.md) step to automatically subscribe contacts to email campaigns.

## Allowing recipients to unsubscribe from email campaigns

Kentico contains two macros that generate an address that you can use in unsubscription links of your email campaigns:

- **UnsubscribeFromCampaign**- creates an address to the unsubscription page, as defined by the _Unsubscription page URL_ property of the given email campaign. 
  - On the page, the recipient is unsubscribed from a specific email campaign.
  - If 'Send confirmation email' is enabled in the 'Newsletter unsubscription' web part, recipients receive a confirmation email.
  - Unsubscribing using an address created by this macro **logs** the 'Unsubscription from a single email campaign' [activity](https://docs.kentico.com/k9/on-line-marketing-features/contact-management/tracking-contact-activities/reference-activity-types.md).
- **UnsubscribeFromAllCampaigns**- creates an address to the unsubscription page, as defined by the _Unsubscription page URL_ property of the given email campaign. 
  - On the page, the recipient is unsubscribed from all email campaigns. This link can behave in two ways, based on the [Opt-out list setting](https://docs.kentico.com/k9/configuring-kentico/managing-sites/configuring-settings-for-sites/settings-on-line-marketing/settings-email-marketing.md).
  - After unsubscribing, recipients **do not** receive a confirmation email.
  - Unsubscribing using an address created by this macro **logs** the 'Unsubscription from all email campaigns' [activity](https://docs.kentico.com/k9/on-line-marketing-features/contact-management/tracking-contact-activities/reference-activity-types.md).
  - You can segment contacts that unsubscribed from all email campaigns using the [UnsubscribedFromAllEmails macro](https://docs.kentico.com/k9/on-line-marketing-features/on-line-marketing-macros.md).
  - Recipients unsubscribed from all campaigns can still receive regular and transactional emails.

You can use these macros in:

- **Email campaign templates** - for emails in static email campaigns that use a [predefined template](https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/working-with-email-campaigns/preparing-email-campaign-templates.md)
- **Links that you create on pages** - for [dynamic newsletters](https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/working-with-email-campaigns/creating-dynamic-newsletters.md)

> **Info:** **Managing unsubscriptions from all marketing campaigns**
>
> - You can [unsubscribe a recipient](https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/managing-email-marketing-subscribers.md) from all email marketing campaigns manually.
> - You can [remove a recipient](https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/managing-email-marketing-subscribers.md#removing-recipients-who-unsubscribed-from-all-email-marketing-campaigns) who unsubscribed from all email marketing campaigns.

## Email marketing web parts

To integrate [email marketing](https://docs.kentico.com/k9/on-line-marketing-features/email-marketing/working-with-email-campaigns.md) into your website, place the following web parts onto pages:

| Web part                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Newsletter subscription   | Displays a dialog that allows website visitors to subscribe to newsletters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Custom subscription form  | Provides an email campaign subscription form similar to the the _Subscription_ web part. You can, however, set up this web part to use a different layout and appearance.<br>You need to define the customized subscription form as an [alternative form](https://docs.kentico.com/k9/configuring-kentico/creating-alternative-forms.md):<br>Open the **Modules** application.<br>**Edit** () the **Email marketing** module.<br>Select the **Classes** tab and edit the **Newsletter - Subscriber** class.<br>Create the form on the **Alternative forms** tab. |
| Newsletter unsubscription | Unsubscribes users from an newsletter and displays a confirmation message. Users are typically directed to the page containing this web part through Unsubscribe links in individual campaign emails. The web part reads the exact email campaign and subscriber from parameters passed in the query string of the URL.                                                                                                                                                                                                                                          |
| Email campaign archive    | Displays archived issues of a specified email campaign to authenticated users.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Unsubscription request    | This web part allows email campaign subscribers to request an unsubscription email by submitting their email address.<br>The content of the email is based on th&#x65;_&#x45;mail campaigns - Unsubscription request_ e‑mail template. You can edit the template in the **Email templates** application.<br>The unsubscription link in the sent email does not expire. Subscribers can use it to unsubscribe from email campaigns for an unlimited amount of time.                                                                                               |
| My subscriptions          | This web part can be used by users to add or remove their newsletter subscriptions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| My account                | Can be configured to display email campaign subscriptions. Users can then add or remove their subscriptions.                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Subscription approval     | Approves subscriptions to newsletter with double opt-in enabled and displays a confirmation message. Subscribers are typically directed to the page containing this web part through a link in the double opt-in activation email. An identifier of the exact subscription is read from a parameter passed in the query string of the URL.                                                                                                                                                                                                                       |
