# toggle_site_emails

Source: https://modulify.ai/docs/mcp/emails/toggle-site-emails

Turns email sending on or off for a site, keeping its address, settings, blocked list and history either way.

- Title: Turn the email sending of a site on or off
- Scope: `config:write`
- Access: Makes changes

Sending is on by default for every site until somebody turns it off. While it is off, every send the site's own code attempts is refused there and then and nothing is queued, so those messages are lost rather than delayed, and a form or a receipt that depends on them quietly stops working. Nothing else changes: the sending address, the settings, the blocked list and the send history are all kept, and forwarding of mail sent to the site carries on either way.

Turning it on resumes sending with the same address and sends nothing by itself. It makes sure the site has its `EMAIL_URL` and `EMAIL_PRIVATE_KEY` values and hands them to the running preview at once, and the answer says when the live site still needs a publish before its email works.

Turning it on is refused when email sending is not set up on the platform, and when the site already has its own secret named `EMAIL_URL` or `EMAIL_PRIVATE_KEY`, which has to be renamed or deleted first. It is also refused when sending was [turned off on its own](https://modulify.ai/docs/automations/emails#automatic-switch-off) because too many of the site's messages bounced or were marked as spam. Only you can turn it back on then, from the **Emails** tab, after cleaning up the recipient list, because turning it on again without that only has it turned off again and damages how every mailbox treats the site. See [Turn sending off and on](https://modulify.ai/docs/automations/emails#turn-sending-off-and-on).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `enabled` | boolean | Yes | True to turn sending on, false to turn it off. |