[{"data":1,"prerenderedAt":28},["ShallowReactive",2],{"doc-inbound-email":3},{"html":4,"headings":5},"\u003Cp>Give a project an email address (\u003Ccode>support@lightbites.app\u003C\u002Fcode>) and every message sent to it becomes a conversation in\nthe inbox. Your replies, and the AI assistant's, go back by email, threaded in the customer's mail app, and what\nthey answer comes back into the same conversation.\u003C\u002Fp>\n\u003Cp>Community installs get this with no limits. On HelpBites Cloud it is part of the Pro plan (\u003Ccode>inboundEmail\u003C\u002Fcode>).\nCreating addresses needs the \u003Ccode>projects.manage\u003C\u002Fcode> permission. It needs Mailgun, the same account the server already\nsends through (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Felrumo\u002Fhelp-bites-oss\u002Fblob\u002Fmain\u002Fdocs\u002FEMAIL.md\" target=\"_blank\" rel=\"noopener\">EMAIL.md\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"two-ways-to-receive-mail\">Two ways to receive mail\u003Ca class=\"heading-anchor\" href=\"#two-ways-to-receive-mail\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cdiv class=\"table-wrap\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003C\u002Fth>\n\u003Cth>Forward my mailbox\u003C\u002Fth>\n\u003Cth>Use my domain\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Address\u003C\u002Ftd>\n\u003Ctd>A HelpBites alias, \u003Ccode>in-…@&lt;INBOUND_DOMAIN&gt;\u003C\u002Fcode>, that your existing \u003Ccode>support@lightbites.app\u003C\u002Fcode> forwards to.\u003C\u002Ftd>\n\u003Ctd>\u003Ccode>support@mail.lightbites.app\u003C\u002Fcode>, on a domain you point at the mail provider.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>DNS\u003C\u002Ftd>\n\u003Ctd>None.\u003C\u002Ftd>\n\u003Ctd>MX records for the domain (the panel shows them).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Your current mail\u003C\u002Ftd>\n\u003Ctd>Untouched: \u003Ccode>lightbites.app\u003C\u002Fcode> keeps Google Workspace, iCloud or whatever it has.\u003C\u002Ftd>\n\u003Ctd>\u003Cstrong>All\u003C\u002Fstrong> mail for that domain goes to the provider. Use a subdomain (\u003Ccode>mail.lightbites.app\u003C\u002Fcode>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Replies come from\u003C\u002Ftd>\n\u003Ctd>The project's sender; \u003Ccode>Reply-To\u003C\u002Fcode> is \u003Ccode>support@lightbites.app\u003C\u002Fcode>, so answers come back through your forward. Set up a sending domain for \u003Ccode>lightbites.app\u003C\u002Fcode> (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Felrumo\u002Fhelp-bites-oss\u002Fblob\u002Fmain\u002Fdocs\u002FEMAIL.md\" target=\"_blank\" rel=\"noopener\">EMAIL.md\u003C\u002Fa>) and replies are sent \u003Cem>from\u003C\u002Fem> it too.\u003C\u002Ftd>\n\u003Ctd>The address itself, when its domain is the project's sending domain.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>Add one in \u003Cem>Project → Email → Settings → Support email addresses\u003C\u002Fem> (web or the native app), or over the API below.\nForwarding: ask your mailbox provider to forward mail for \u003Ccode>support@lightbites.app\u003C\u002Fcode> to the alias. Domain: add\nthe MX records, then \u003Cstrong>Check DNS\u003C\u002Fstrong>; the address is \u003Cem>Receiving\u003C\u002Fem> when they are found.\u003C\u002Fp>\n\u003Ch2 id=\"what-happens-to-a-message\">What happens to a message\u003Ca class=\"heading-anchor\" href=\"#what-happens-to-a-message\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Col>\n\u003Cli>Mailgun posts it to \u003Ccode>POST \u002Fv1\u002Fwebhooks\u002Fmailgun-inbound\u003C\u002Fcode> (signed with \u003Ccode>MAILGUN_WEBHOOK_SIGNING_KEY\u003C\u002Fcode>, each\nsignature accepted once).\u003C\u002Fli>\n\u003Cli>The recipient is matched to an address. Mail for an address that is unknown, removed or not verified, or for a\nworkspace whose plan lacks \u003Ccode>inboundEmail\u003C\u002Fcode>, is accepted and dropped: nothing is ever bounced back.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Dropped without a conversation:\u003C\u002Fstrong> automatic replies (out-of-office, \u003Ccode>Auto-Submitted\u003C\u002Fcode>, bulk and list mail,\ndelivery failures) and mail from one of the project's own addresses, so two auto-responders cannot loop.\nMore than 20 messages an hour from one sender, or 300 an hour to one project, are dropped too.\u003C\u002Fli>\n\u003Cli>The sender becomes a \u003Cstrong>contact\u003C\u002Fstrong> (an existing contact with that address is reused). The \u003Ccode>From\u003C\u002Fcode> header is not\nproof of who wrote it, so mail never signs anyone in.\u003C\u002Fli>\n\u003Cli>The mail continues a conversation when it replies to one (\u003Ccode>In-Reply-To\u003C\u002Fcode> \u002F \u003Ccode>References\u003C\u002Fcode>, or the \u003Ccode>+c_&lt;id&gt;\u003C\u002Fcode> in the\naddress a reply was sent to), \u003Cstrong>and\u003C\u002Fstrong> it comes from that conversation's contact. Anything else starts a new\nconversation, titled with the subject. A reply to a closed conversation reopens it.\u003C\u002Fli>\n\u003Cli>The text is what the sender typed (the quoted earlier message is cut off), up to 8,000 characters. PNG, JPEG,\nGIF and WebP attachments (4 at most, 8 MB each) are kept; other files are listed as &quot;Not shown&quot;.\u003C\u002Fli>\n\u003Cli>The team is notified as for any new conversation, and an assistant with auto-reply on answers, by email.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>A conversation that came in by email shows an envelope in the inbox, and the inbox can be filtered to Email.\u003C\u002Fp>\n\u003Ch2 id=\"replies\">Replies\u003Ca class=\"heading-anchor\" href=\"#replies\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every reply to an email conversation is mailed (there is no five-minute batching as in chat), with the subject\n\u003Ccode>Re: …\u003C\u002Fcode>, the thread's \u003Ccode>In-Reply-To\u003C\u002Fcode> and \u003Ccode>References\u003C\u002Fcode>, and a \u003Ccode>Reply-To\u003C\u002Fcode> of the project's address carrying the\nconversation id (\u003Ccode>support+c_&lt;id&gt;@lightbites.app\u003C\u002Fcode>). Replies by the assistant, the operator panel, the native app,\nthe admin API and MCP all go the same way.\u003C\u002Fp>\n\u003Ch2 id=\"set-it-up-on-a-server\">Set it up on a server\u003Ca class=\"heading-anchor\" href=\"#set-it-up-on-a-server\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Col>\n\u003Cli>Your Mailgun account must receive mail for the domains: add each domain in Mailgun (a sending domain you\nalready use works). For forwarding, add a domain for aliases and set \u003Ccode>INBOUND_DOMAIN\u003C\u002Fcode> to it (\u003Ccode>inbound.example.com\u003C\u002Fcode>);\nits MX must point at Mailgun.\u003C\u002Fli>\n\u003Cli>Create \u003Cstrong>one\u003C\u002Fstrong> Mailgun Route for the whole account: expression \u003Ccode>match_recipient(&quot;.*&quot;)\u003C\u002Fcode>, action\n\u003Ccode>forward(&quot;https:\u002F\u002F&lt;APP_URL&gt;\u002Fv1\u002Fwebhooks\u002Fmailgun-inbound&quot;)\u003C\u002Fcode>. Mailgun signs these posts with the account's webhook\nsigning key, the same \u003Ccode>MAILGUN_WEBHOOK_SIGNING_KEY\u003C\u002Fcode> the delivery webhook uses. Check this against your region's\nMailgun documentation.\u003C\u002Fli>\n\u003Cli>Optional: \u003Ccode>INBOUND_DOMAIN\u003C\u002Fcode>. Without it the server offers \u003Cem>Use my domain\u003C\u002Fem> only.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2 id=\"api\">API\u003Ca class=\"heading-anchor\" href=\"#api\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>All calls need an operator session or an \u003Ccode>ak_\u003C\u002Fcode> admin key. Errors: \u003Ccode>400\u003C\u002Fcode> (not an address, a reserved domain, too\nmany), \u003Ccode>402\u003C\u002Fcode> (the plan has no support email addresses), \u003Ccode>403\u003C\u002Fcode> (the domain is not verified for this workspace),\n\u003Ccode>409\u003C\u002Fcode> (taken by another project). Up to 5 addresses per project.\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cbutton type=\"button\" class=\"copy-btn\" data-copy aria-label=\"Copy to clipboard\">Copy\u003C\u002Fbutton>\u003Cpre class=\"shj-lang-bash\">\u003Ccode>\u003Cspan class=\"shj-syn-cmnt\"># Forwarding alias for the address your customers know\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -X\u003C\u002Fspan> POST https:\u002F\u002Fhelp.example.com\u002Fv1\u002Fadmin\u002Fprojects\u002FPROJECT_ID\u002Finbound-addresses \\\n \u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Content-Type: application\u002Fjson\"\u003C\u002Fspan> \\\n \u003Cspan class=\"shj-syn-kwd\"> -d\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">'{\"kind\":\"forward\",\"publicAddress\":\"support@lightbites.app\",\"fromName\":\"Lightbites Support\"}'\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-cmnt\"># → { \"address\": { \"id\": \"…\", \"address\": \"in-9f2c…@inbound.example.com\", \"state\": \"verified\", … } }\u003C\u002Fspan>\n\n\u003Cspan class=\"shj-syn-cmnt\"># An address on your own subdomain, then check its MX records\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -X\u003C\u002Fspan> POST …\u002Finbound-addresses\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Content-Type: application\u002Fjson\"\u003C\u002Fspan> \\\n \u003Cspan class=\"shj-syn-kwd\"> -d\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">'{\"kind\":\"domain\",\"address\":\"support@mail.lightbites.app\"}'\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -X\u003C\u002Fspan> POST …\u002Finbound-addresses\u002FADDRESS_ID\u002Fverify\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\n\n\u003Cspan class=\"shj-syn-cmnt\"># List, remove\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan> …\u002Finbound-addresses\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -X\u003C\u002Fspan> DELETE …\u002Finbound-addresses\u002FADDRESS_ID\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\n\n\u003Cspan class=\"shj-syn-cmnt\"># Only the conversations that came in by email\u003C\u002Fspan>\n\u003Cspan class=\"shj-syn-func\">curl\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"https:\u002F\u002Fhelp.example.com\u002Fv1\u002Fadmin\u002Fconversations?channel=email\"\u003C\u002Fspan>\u003Cspan class=\"shj-syn-kwd\"> -H\u003C\u002Fspan> \u003Cspan class=\"shj-syn-str\">\"Authorization: Bearer \u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">$HELPBITES_ADMIN_KEY\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Conversations carry \u003Ccode>channel\u003C\u002Fcode> (\u003Ccode>email\u003C\u002Fcode> or \u003Ccode>widget\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Ch2 id=\"in-a-web-page-or-an-app\">In a web page or an app\u003Ca class=\"heading-anchor\" href=\"#in-a-web-page-or-an-app\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>There is nothing to embed: the address is the entry point. Put it on a page as a link, or let your own form post\nto the public API instead (\u003Ca href=\"\u002Fdocs\u002Fsupport\">SUPPORT.md\u003C\u002Fa>):\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cbutton type=\"button\" class=\"copy-btn\" data-copy aria-label=\"Copy to clipboard\">Copy\u003C\u002Fbutton>\u003Cpre class=\"shj-lang-html\">\u003Ccode>\u003Cspan class=\"shj-syn-var\">\u003C\u002Fspan>\u003Cspan class=\"shj-syn-oper\">&lt;\u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">a\u003C\u002Fspan> \u003Cspan class=\"shj-syn-class\">href\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\u003C\u002Fspan>\u003Cspan class=\"shj-syn-oper\">=\u003C\u002Fspan>\u003Cspan class=\"shj-syn-str\">\"mailto:support@lightbites.app\"\u003C\u002Fspan>\u003Cspan class=\"shj-syn-oper\">&gt;\u003C\u002Fspan>Email support\u003Cspan class=\"shj-syn-var\">\u003C\u002Fspan>\u003Cspan class=\"shj-syn-oper\">&lt;\u002F\u003C\u002Fspan>\u003Cspan class=\"shj-syn-var\">a\u003C\u002Fspan>\u003Cspan class=\"shj-syn-oper\">&gt;\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>In a SwiftUI app, open the user's mail composer with the same address (no package, no key):\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cbutton type=\"button\" class=\"copy-btn\" data-copy aria-label=\"Copy to clipboard\">Copy\u003C\u002Fbutton>\u003Cpre class=\"shj-lang-plain\">\u003Ccode>import SwiftUI\n\nstruct EmailSupportButton: View {\n    var address = \u003Cspan class=\"shj-syn-str\">\"support@lightbites.app\"\u003C\u002Fspan>\n    var title = \u003Cspan class=\"shj-syn-str\">\"Email support\"\u003C\u002Fspan>\n    @Environment(\\.openURL) private var openURL\n\n    var body: some View {\n        Button(title) { openURL(URL(string: \u003Cspan class=\"shj-syn-str\">\"mailto:\\(address)\"\u003C\u002Fspan>)!) }\n    }\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch2 id=\"limits\">Limits\u003Ca class=\"heading-anchor\" href=\"#limits\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Only Mailgun receives mail. Attachments other than images are not kept.\u003C\u002Fli>\n\u003Cli>A sender's own mail program decides whether a reply carries \u003Ccode>In-Reply-To\u003C\u002Fcode>; a mail that does not and has no\n\u003Ccode>+c_&lt;id&gt;\u003C\u002Fcode> tag starts a new conversation.\u003C\u002Fli>\n\u003Cli>A forwarding rule that rewrites \u003Ccode>To\u003C\u002Fcode> and drops the original (some providers) loses the \u003Ccode>+c_&lt;id&gt;\u003C\u002Fcode> tag; replies\nstill thread through \u003Ccode>In-Reply-To\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n",[6,10,13,16,19,22,25],{"id":7,"text":8,"level":9},"two-ways-to-receive-mail","Two ways to receive mail",2,{"id":11,"text":12,"level":9},"what-happens-to-a-message","What happens to a message",{"id":14,"text":15,"level":9},"replies","Replies",{"id":17,"text":18,"level":9},"set-it-up-on-a-server","Set it up on a server",{"id":20,"text":21,"level":9},"api","API",{"id":23,"text":24,"level":9},"in-a-web-page-or-an-app","In a web page or an app",{"id":26,"text":27,"level":9},"limits","Limits",1794596525501]