Send one email to one or several people (a supplier, a customer, an accountant) from the user's own mailbox (Gmail or Outlook).
Use it when the user asks you to email, write to, or message someone else. To notify the user themselves, use well_send_notification instead.
- `to`: a list of the recipients' email addresses, one entry per address. Use the addresses the user gave, or ones read from Well's records; never guess one. Ask the user when you do not have it. One email goes to all of them: do not call this tool once per recipient.
- `cc` and `bcc`: optional lists of addresses in copy and in blind copy. Fill them only when the user asked for a copy.
- `subject` and `body`: write them in the user's language, with what the user asked to say. The body is plain text; line breaks are kept.
- `invoice_id`: the id of an issued invoice, only when the user asks you to send that invoice or to chase its customer for it, and you hold its id from Well's records (an invoice you issued or read in this conversation). Well then records the email against the invoice, attaches the invoice's PDF when it is small enough to go as a file, and ends the body with a lasting link to the PDF, which the card shows: never write a link to the invoice in the body yourself, and never say a file is attached unless the result's `attached_file` names it. Leave it out for every other email, and never guess or invent an id. A draft invoice, or an invoice of another workspace, is refused before anything is sent.
- A sales invoice goes out once, then is chased at most once per lateness band (1 to 30, 31 to 60, 61 to 90, over 90 days late). When the result has code `invoice_already_sent`, nothing was sent: follow its message.
- `send_again`: set it to true when the user knows the invoice already went out at this step (you told them, or they said so) and asks to send it again anyway, for example to a corrected address or as a copy the customer asked for, or when an `invoice_already_sent` result tells you to. The card then says it sends the invoice again, and the user approves it there; nothing leaves before that. Never set it otherwise.
- `reply_to_note_id`: the `note_id` of the mail this email answers, read from the user's own email records. The email then goes out as a reply in that mail's thread, from the mailbox that received it. Well writes the subject of a reply itself: that mail's subject with "Re: " in front, which the card shows. Leave it out for a new email, and never guess an id. When the result has code `reply_target_not_found`, nothing was sent: tell the user, and do not send it as a new email unless they ask.
- `accountant_package`: instead of a written email, send the accountant the package of one closed month: its receipts as a ZIP, the reconciliation and the journal, given as `calendar_year` and `calendar_month`. Set `include_fec` only when the user asks for the FEC. Never combine it with `invoice_id` or `reply_to_note_id`. When the result has code `accountant_package_too_large`, call again with the same values and `delivery` set to `"link"`.
This call sends nothing. It returns an approval link: give it to the user and say the email goes out only after they open the link in Well, read it and approve it there. Never say the email was sent, and never call this tool again for the same email unless the user asks for a changed one (a changed email needs a new link) or an invoice_already_sent result tells you to.
When the result has code `missing_send_scope` or `gmail_reconnect_required`, Well cannot send from the user's mailbox yet: give the user the reconnect link from the message, and call this tool again with the same values once they say they reconnected. With `mailbox_send_right_missing`, say only that the mailbox cannot send, with no link. Offer an `other_space_mailbox` by its address, and on a yes call again with `sender_mailbox_id` set to its `mailbox_id`. Never send the email another way.
When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass `workspace_id` on the call.