pinecallDocs
Integrations / Email

Email

A mailbox of yours answered by an agent: read over IMAP, replies set in your HTML layout.

Answer the emails written to a mailbox of yours with an agent. Each email thread is one conversation, in writing; the reply goes out from the same address, set in your own HTML layout, threaded under the email it answers, and your team reads and joins it from the console.

How it works#

You bring the mailbox once, with the logins your mail client would use. Pinecall reads it; nothing is pointed anywhere. When somebody writes to it:

Your agent's code does not change. The call's channel is email, which is written, and the prompt tells the model to write a whole email in one message: Pinecall's own words, or yours with channelRules = { email: "…" } (The prompt).

Connect a mailbox#

Bring the mailbox#

Terminal
$ pinecall carriers add email --address help@yourcompany.com --imap-host mail.yourcompany.com --smtp-host mail.yourcompany.com --name "Your Company"
mailbox password (IMAP): ••••••••
kept: help@yourcompany.com · email
  → pinecall numbers import help@yourcompany.com --agent <slug> --channel email gives it to an agent

The password is typed with nothing echoed, or piped on stdin. Pinecall logs in to both IMAP and SMTP before it keeps anything, and a login the server refuses is said in its words. IMAP is 993 over TLS; SMTP is 465 over TLS, or --smtp-port 587 for STARTTLS.

Send through a relay, if you use one#

When your replies leave through a relay with a login of its own, name its host and login: its password is asked after the mailbox's.

Terminal
$ pinecall carriers add email --address help@yourcompany.com --imap-host mail.yourcompany.com \
    --smtp-host email-smtp.us-east-1.amazonaws.com --smtp-port 587 --smtp-username AKIA… --name "Your Company"

With Amazon SES, the address (or its domain) must be verified in SES, and the login is an SES SMTP credential, not your AWS keys.

Give the address to an agent#

Terminal
$ pinecall numbers import help@yourcompany.com --agent front-desk --channel email

From then on, every email that arrives is answered. What was already in the inbox is left alone.

The same from the console: Mailboxes in the menu, or an agent's Channels tab, Email, Connect a mailbox. A mailbox's page shows what an email to it goes through, where it is read and where its replies leave, and Server settings changes them: a password left empty keeps the one it has. Mailboxes are their own page: they are never listed with the org's numbers. From an assistant connected by MCP, the address is given with the numbers tool; the mailbox's password is never passed through an assistant, so bringing the mailbox stays a command you type.

The reply and your layout#

The agent writes the reply in plain words: paragraphs, lists with -, **bold**, *italics*, links and images (![what it shows](https://…), when its instructions give it an image's address). Pinecall turns them into HTML (anything else stays text, so nothing in a contact's email or the model's reply can be HTML of its own) and sets them in your layout: an HTML page that says {{content}} once, where the reply goes, and {{subject}} wherever the subject should show.

Terminal
$ pinecall email layout set yourcompany.html
$ pinecall email layout preview "Hola Ana,\n\n- **sábado** de 10 a 14\n- domingo cerrado" --subject Horarios --out reply.html

preview sends nothing: it writes the email as the contact would read it.

A template is a choice, not a requirement. There are four ways to send, one for the whole org:

what the contact gets
Text only No template and no HTML: the email is its words as plain text, the marks taken off, each link's address written beside its words. pinecall email layout text
No template What every org starts with: the words as simple HTML on white, in the reader's own font and nobody's brand, with their bold, lists, links and images. pinecall email layout clear
Simple A template made in the console from your brand's name, a colour, a logo's address and a footer. No HTML to write
HTML Your own page. pinecall email layout set yourcompany.html

In the console they are the four buttons of the How the emails look card, on a mailbox's page under Mailboxes and in an agent's Channels tab. Whichever is picked, the reply on the right is a real one sent that way, from words you can change, and Save keeps it for every agent's emails.

Each reply answers under Re: and the subject, and carries the headers every mail client threads by, so it lands in the contact's conversation, not as a new email. It also says it was written by no person (Auto-Submitted), so another robot's autoresponder does not answer it.

What the agent reads#

Reads What the person wrote: the plain part of the email (or its HTML, as text), with the quoted past and the signature cut off. Attachments are not read.
Does not answer Emails no person wrote: bounces, no-reply senders, autoresponders, mailing lists and bulk mail, and the mailbox's own.

Conversations#

Each email thread is its own conversation: one person writing on two subjects has two, each with its own reply chain. In the console they are in Calls (pick Email in Showing to see those alone), one row a thread with its subject; a thread opens as a mailbox shows it, the newest email open and the agent's as the contact read it. The agent remembers what that person and the agent last said to each other on any channel, so a new thread goes on from there. A thread quiet for two hours is over in the console; the next email in it opens a new conversation that carries the last one on.

Each reply counts against your org's messages and llm_tokens limits (Limits & provider keys). Your mail server or relay sends the emails; Pinecall adds nothing to what they charge.

Stop answering email#

Terminal
$ pinecall numbers drop help@yourcompany.com --channel email

The inbox is read no more; the mailbox stays as it is, and its account in Pinecall until pinecall carriers drop help@yourcompany.com.