Skip to content

Function: codeEmailTextBody()

codeEmailTextBody(code, opts): string

The text/plain part, supplied EXPLICITLY rather than rendered from the tree above. Both parts say the same thing; only the line layout differs.

The prompt and the code share ONE line (“Your verification code is: 123456”). That single-line shape is what iOS, Gmail, Outlook, and Android code detection keys on most reliably - the heuristics look for a code in the same sentence as a recognized prompt, so splitting them across lines makes detection dependent on the client, and any blank line between them defeats it outright.

The GENERATED text part cannot hold that shape at all: it is a rendering of the HTML, so it carries the brand header/footer and turns the code heading’s CSS margin into blank lines, arriving as prompt\n\n\ncode.

The code is visible text in BOTH parts, never an image, so a client scraping either one finds it. No trailer line follows the copy - Apple’s domain-bound @domain #code footer is deliberately NOT emitted, since it constrains the code to one origin and is not what the broadly-compatible shape needs.

string

CodeCopy

string