draft_email from Day 6 creates a draft you can review. Now imagine the weekly literature digest is templated, reviewed, and ready. What's the step between "draft confirmed" and "sent to all co-authors"?
draft_email saved the draft — so I'd open Gmail and click Send. But that's manual again. If I want to automate the send, I need GMAIL_SEND_EMAIL.
Correct. GMAIL_SEND_EMAIL delivers the message immediately — no draft, no browser, no click. The parameters are identical to draft_email: to, subject, body. The difference is the outcome. Draft is reversible; send is not.
When the test runs, will it actually send an email to whoever I put in to? I don't want to accidentally email my supervisor.
That's why the safe pattern is to=your_own_email for every test run. Write send_email to send to self, confirm it lands in your Sent folder, then when you're confident the function works correctly, update the recipient. The function itself doesn't restrict who you send to — your discipline does:
def send_email(to: str, subject: str, body: str) -> dict:
result = toolset.execute_action(
Action.GMAIL_SEND_EMAIL,
{"to": to, "subject": subject, "body": body}
)
print(f"Email sent to: {to}")
return resultI ran draft_email four times, reviewed the wording, confirmed the subject line format — then switched to send_email. It showed up in my Sent folder immediately. That moment is different from anything I expected.
The "wait, it's actually in my Sent folder" moment. That's the point of no return.
I've just automated the weekly co-author digest. Same function, different subject line per week. The boring part is gone.
A deduplication log is just two lines:
result = send_email(to, subject, body)
sent_log.append({"to": to, "subject": subject, "timestamp": "today"})GMAIL_SEND_EMAIL has no deduplication — calling it twice sends two emails. Draft-and-verify before every live send.
GMAIL_CREATE_EMAIL_DRAFT → message in Drafts. Reversible. Review in Gmail before delivering.
GMAIL_SEND_EMAIL → message delivered immediately. No undo.
Always test send functions with to=your_own_email. Any accidental duplicate lands in your Sent folder, not a colleague's inbox. Test once before wiring into any automated workflow.
GMAIL_SEND_EMAIL sends every time it is called. Two calls = two emails. Guard with a timestamp log in production workflows.
| Action | Reversible | Use case |
|---|---|---|
GMAIL_CREATE_EMAIL_DRAFT | Yes | Review before send |
GMAIL_SEND_EMAIL | No | Confirmed sends only |
draft_email from Day 6 creates a draft you can review. Now imagine the weekly literature digest is templated, reviewed, and ready. What's the step between "draft confirmed" and "sent to all co-authors"?
draft_email saved the draft — so I'd open Gmail and click Send. But that's manual again. If I want to automate the send, I need GMAIL_SEND_EMAIL.
Correct. GMAIL_SEND_EMAIL delivers the message immediately — no draft, no browser, no click. The parameters are identical to draft_email: to, subject, body. The difference is the outcome. Draft is reversible; send is not.
When the test runs, will it actually send an email to whoever I put in to? I don't want to accidentally email my supervisor.
That's why the safe pattern is to=your_own_email for every test run. Write send_email to send to self, confirm it lands in your Sent folder, then when you're confident the function works correctly, update the recipient. The function itself doesn't restrict who you send to — your discipline does:
def send_email(to: str, subject: str, body: str) -> dict:
result = toolset.execute_action(
Action.GMAIL_SEND_EMAIL,
{"to": to, "subject": subject, "body": body}
)
print(f"Email sent to: {to}")
return resultI ran draft_email four times, reviewed the wording, confirmed the subject line format — then switched to send_email. It showed up in my Sent folder immediately. That moment is different from anything I expected.
The "wait, it's actually in my Sent folder" moment. That's the point of no return.
I've just automated the weekly co-author digest. Same function, different subject line per week. The boring part is gone.
A deduplication log is just two lines:
result = send_email(to, subject, body)
sent_log.append({"to": to, "subject": subject, "timestamp": "today"})GMAIL_SEND_EMAIL has no deduplication — calling it twice sends two emails. Draft-and-verify before every live send.
GMAIL_CREATE_EMAIL_DRAFT → message in Drafts. Reversible. Review in Gmail before delivering.
GMAIL_SEND_EMAIL → message delivered immediately. No undo.
Always test send functions with to=your_own_email. Any accidental duplicate lands in your Sent folder, not a colleague's inbox. Test once before wiring into any automated workflow.
GMAIL_SEND_EMAIL sends every time it is called. Two calls = two emails. Guard with a timestamp log in production workflows.
| Action | Reversible | Use case |
|---|---|---|
GMAIL_CREATE_EMAIL_DRAFT | Yes | Review before send |
GMAIL_SEND_EMAIL | No | Confirmed sends only |
Create a free account to get started. Paid plans unlock all tracks.