> ## 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

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

> [!WARNING]
>
> Verify a sending domain in your workspace before any restaurant sends a campaign (**Settings → Domain**, see
> [Go live](https://docs.minimo.it/embedded/go-live.md#2-sending-domain-and-senders)). Without it the send fails and the widget shows
> only `INVALID_PARAMETERS`.

## 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/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>`.

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

## 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/embedded/widget-brand.md). If you expose no campaign template the restaurant cannot create a campaign. The **Template** menu shows each starter by its template name, as you wrote it: use names your restaurants understand.

## Who receives it

* Only guests of **this** restaurant, whatever ids the page sends. Contacts of your workspace and of other restaurants are never reached.
* Only guests whose consent to this restaurant was recorded with its evidence: a campaign is a marketing email (see [consent per restaurant](https://docs.minimo.it/embedded/consent.md#consent-per-restaurant)).
* Never an address that bounced, complained or unsubscribed.
* Never an address that is not valid, a throwaway mailbox or a generic one like `info@`: they are skipped, and a list where too many addresses are like this is refused as a whole (see [clean lists](https://docs.minimo.it/embedded/protections.md#clean-lists)).

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

* **Optional review:** unless your workspace has it switched off, the first 3 campaigns of each restaurant are reviewed by Minimo before they go out (see [Protections](https://docs.minimo.it/embedded/protections.md#optional-review-of-the-first-campaigns)). When it applies, 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/embedded/senders-and-sending.md#3-name-the-customer-with-tenant) and the [statistics](https://docs.minimo.it/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

* The guest is created (or updated) as a guest of this restaurant, with its consent and evidence only when the box is ticked. The answer is the same whether or not the address exists in your workspace or at another restaurant, and nothing of theirs is changed or shown.
* A restaurant's guest is not a contact of your workspace: it does not appear in your dashboard and never starts your workspace automations.

## If something fails

A send without a verified sending domain in your workspace fails with `400 INVALID_PARAMETERS`. The marketing limits (`TENANT_DAILY_CAP_REACHED`, `TENANT_LIST_QUALITY`, `MARKETING_SEND_ON_HOLD`) are explained in [Protections](https://docs.minimo.it/embedded/protections.md). Every code, with what to do: [Errors and limits](https://docs.minimo.it/embedded/errors.md).

## Next step

[Send history widget](https://docs.minimo.it/embedded/widget-history.md)


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