* 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)
| 395 | * understand). |
| 396 | */ |
| 397 | function 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 |
no test coverage detected