> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minimo.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Campaigns widget

> Each restaurant writes a promotion from a template you prepared and sends it to its own guests who agreed to receive it

## What the restaurant sees

![The campaigns widget: the new campaign form with name and subject](https://mintcdn.com/minimo/9ObazzQQNYTDa_5r/images/embedded/widget-campaigns.png?fit=max\&auto=format\&n=9ObazzQQNYTDa_5r\&q=85\&s=08628bbf753c3f1c48eb464d1e993693)

*Shown in Italian. The widget follows the session `locale`.*

1. **New campaign**: a name, a subject and, when you expose two or more campaign templates, a **Template** menu to pick the starter (the first one is the default).
2. **Edit content** opens the Minimo email editor on the campaign, in the restaurant's brand. The footer with the unsubscribe link stays.
3. **Send**: the restaurant picks recipients among **its own** contacts (or selects all), and can **Add contact** (email, first name, a box "Agreed to receive marketing emails"). Contacts without consent are marked and do not receive it.
4. The list shows each campaign with its status: Draft, In review, Sending, Sent, Partly sent, Not approved.

## Mount it

Permission `campaigns` (in the default). With `contacts` too (also in the default) the restaurant can see, pick and add recipients; without it the widget can only send to all the restaurant's contacts.

```html theme={null}
<div id="minimo-campaigns"></div>
<script src="https://api.minimo.it/public/v1/embed/widgets/widgets.js"></script>
<script>
  Minimo.mountWidget({
    url: session.urls.campaigns,
    container: '#minimo-campaigns',
    minHeight: 760,
    onEvent: function (event) {
      if (event.type === 'campaign.sent') console.log(event.data.status, event.data.recipients);
    },
  });
</script>
```

Pass `from` when you [mint the session](https://docs.minimo.it/guides/embedded-widgets.md#1-create-a-session-your-backend) to send the restaurant's campaigns from its own sender, for example `Trattoria da Mario <news@trattoriadamario.yoursaas.example>`.

## Starters

The starters are your **campaign** templates listed in `masterTemplateIds` of `PUT /public/v1/widgets/settings`. Each new campaign is a copy of the starter, already in the restaurant's [brand color](https://docs.minimo.it/guides/embedded-widget-brand.md). If you expose no campaign template the restaurant cannot create a campaign.

## Who receives it

* Only contacts of **this** restaurant (tag `tenant:<tenant>` in your workspace), whatever ids the page sends.
* Only contacts with **marketing consent**: a campaign is a marketing email. With [consent per tenant](https://docs.minimo.it/guides/embedded-consent.md#consent-per-tenant), only guests subscribed to this restaurant.
* Never an address that bounced, complained or unsubscribed.

Then the same checks as every campaign of your workspace, plus the tenant ones (see [Protections and sending limits](https://docs.minimo.it/guides/embedded-protections.md)):

* **The first 3 campaigns of each restaurant are reviewed by Minimo** before they go out. The widget shows "Campaign under review: we check the first campaigns of every restaurant before they go out. It is sent automatically once approved." A rejected campaign shows **Not approved**: the restaurant creates a new one.
* A **new restaurant** can send up to 200 promotional emails a day in its first 7 days, then 1,000 a day until day 30.
* Large lists go out in waves, and a restaurant with too many complaints or bounces is paused.

A sent campaign cannot be edited or sent again. Usage counts on your workspace; the [message list](https://docs.minimo.it/guides/embedded-senders-and-sending.md#3-tag-the-send-with-your-tenant) and the [statistics](https://docs.minimo.it/guides/embedded-widget-statistics.md) give you the numbers per restaurant.

## Events

| `widget` | `type` | `data` |
| - | - | - |
| `campaigns` | `ready` | `count` |
| `campaigns` | `campaign.created` | `campaignId` |
| `campaigns` | `contact.added` | `contactId` |
| `campaigns` | `campaign.sent` | `campaignId`, `status` (e.g. `in_review`), `submissionId`, `recipients` |

## Contacts added here

* A guest new to your workspace is created with the tag of this restaurant, and with email marketing consent only when the box is ticked.
* A guest your workspace (or another restaurant) already has is **linked**, never modified, and shown by email only.
* A new guest is a normal contact of your workspace: a workspace automation of yours that starts when a contact is created also starts for it. Keep this in mind before you create workspace automations on new contacts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.