Skip to content

Support multipart/alternative email sending #58

Description

@rockbot-rocky

Summary

Enhance calendar-mcp email sending so callers can send proper multipart/alternative messages, especially plain text + HTML email bodies.

Problem

The current send_email behavior appears to support a single body value plus bodyFormat (text or html). That works only when the caller provides the exact content format matching bodyFormat.

This caused real formatting failures:

  • A message sent with bodyFormat: "html" but a plain-text/Markdown-style body arrived as an unformatted text blob because there was no actual HTML markup to render.
  • A message sent with HTML markup but bodyFormat: "text" arrived/rendered incorrectly because the content type did not match the body.

The corrected workaround is to send actual HTML and set bodyFormat: "html", but that is still not as robust as true multipart email.

Requested enhancement

Add explicit support for multipart email sending, ideally multipart/alternative, so callers can provide both:

  • Plain-text fallback body
  • HTML body

Possible API shape:

{
  "accountId": "rockbotagent",
  "to": ["recipient@example.com"],
  "cc": [],
  "subject": "Subject here",
  "bodyFormat": "multipart",
  "textBody": "Plain text fallback",
  "htmlBody": "<!doctype html><html><body><h2>Heading</h2><p>Formatted HTML.</p></body></html>"
}

Alternative shapes are fine; the important requirement is that agents can supply separate plain-text and HTML parts without pretending Markdown is HTML or relying on a single body string.

Acceptance criteria

  • send_email supports sending a message with separate plain-text and HTML representations.
  • Delivered message exposes/contains both MIME alternatives where the provider supports it.
  • Existing single-body body + bodyFormat behavior remains backward compatible.
  • Documentation and guides clearly state:
    • bodyFormat: "html" requires actual HTML markup.
    • Markdown/plain text is not automatically converted to HTML.
    • Multipart support should be used when both readable fallback text and formatted HTML are required.
  • Add tests covering at least:
    • HTML-only single-body send.
    • Text-only single-body send.
    • Multipart plain-text + HTML send.

Context

This came out of a KidsIdKit formatted email failure where the tool path was mistakenly assumed to support multipart email. The current verified safe path is bodyFormat: "html" with actual HTML in body, but multipart support would make formatted outbound email much harder for agents to get wrong.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions