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

Function renderAlternativeParts

apps/sim/tools/gmail/utils.ts:397–413  ·  view source on GitHub ↗

* Render the inner part of a `multipart/alternative` section (text/plain * followed by text/html, per RFC 2046 — clients pick the last format they * understand).

(plain: string, html: string, boundary: string)

Source from the content-addressed store, hash-verified

395 * understand).
396 */
397function renderAlternativeParts(plain: string, html: string, boundary: string): string[] {
398 return [
399 `--${boundary}`,
400 'Content-Type: text/plain; charset="UTF-8"',
401 'Content-Transfer-Encoding: base64',
402 '',
403 ...encodeBodyBase64(plain),
404 '',
405 `--${boundary}`,
406 'Content-Type: text/html; charset="UTF-8"',
407 'Content-Transfer-Encoding: base64',
408 '',
409 ...encodeBodyBase64(html),
410 '',
411 `--${boundary}--`,
412 ]
413}
414
415/**
416 * Build a `multipart/alternative` email (without attachments). Always emits

Callers 2

buildSimpleEmailMessageFunction · 0.85
buildMimeMessageFunction · 0.85

Calls 1

encodeBodyBase64Function · 0.85

Tested by

no test coverage detected