Modulify

Choose the domain a site sends email from

set_site_email_sending_domain

Chooses the domain a site sends its email from, one of its verified email domains or its built-in sending domain.

Scopeconfig:writeMakes changes

Pass the domain exactly as emailDomains.items in get_site_email_settings lists it, or an empty string for the built-in sending domain. Always pass domain, even as an empty string, because leaving it out is refused with Enter a valid domain, such as example.com!

The part in front of the @ (fromLocal) stays the same, so every later message goes out from that part at the new domain. That resets how mailboxes recognize the site, so the tool tells the client to change it only when you ask.

Only a verified domain can be chosen, and any other is refused with Only a verified email domain can send email! Should a chosen domain stop being verified later, the site sends from its built-in address until it is verified again, which fromFallback reports. Replies to an address on the chosen domain reach that domain's own mailboxes unless receiving is on for it or a reply-to is set.

It needs the Manage domains permission and works on every plan, except that a paused domain cannot be chosen and is refused with Email domains are paused until the workspace is on a paid plan again! See Choose the domain the site sends from.

Inputs

Input Type Required Description
projectId string Yes The site id.
domain string No A verified email domain of the site, as emailDomains.items lists it, or an empty string to send from the built-in sending domain. Always pass it, because leaving it out is refused.