MCPcopy Index your code
hub / github.com/simstudioai/sim / buildBodyAlternatives

Function buildBodyAlternatives

apps/sim/tools/gmail/utils.ts:372–380  ·  view source on GitHub ↗
(
  body: string,
  contentType: 'text' | 'html' | undefined
)

Source from the content-addressed store, hash-verified

370 * fallback for clients that don't render HTML.
371 */
372export function buildBodyAlternatives(
373 body: string,
374 contentType: 'text' | 'html' | undefined
375): { plain: string; html: string } {
376 if (contentType === 'html') {
377 return { plain: htmlToPlainText(body) || body, html: body }
378 }
379 return { plain: body, html: plainTextToHtml(body) }
380}
381
382/**
383 * Encode a text body as base64 with RFC 2045 line wrapping (max 76 chars).

Callers 2

buildSimpleEmailMessageFunction · 0.85
buildMimeMessageFunction · 0.85

Calls 2

plainTextToHtmlFunction · 0.85
htmlToPlainTextFunction · 0.70

Tested by

no test coverage detected