Skip to content
Chapter 49Lesson 4

Quiz - Authoring templates

Quiz progress

0 / 0

You need a two-column header — logo on the left, a “Open dashboard” link on the right. You write it with <div className="flex justify-between">, and it looks perfect in the preview server. Why is this still the wrong call?

The preview renders in Chrome, which honors flex; Gmail discards it and collapses the two columns into one stack. Use <Row> and <Column>, which compile to the table layout every client understands.
flex works in every client, but <div> is disallowed in React Email templates — you must use <Section> as the outer wrapper for the styles to inline.
The <Tailwind> component would throw a build error on flex, so the template never compiles.

Your brand color is defined in the web app as an OKLCH value in a Tailwind v4 @theme block. What has to happen for it to render reliably on a <Button> across mailbox clients?

Mirror the token into a JS config (emailTailwindConfig) as a hex value, because some clients can’t parse OKLCH and silently drop the whole background-color, leaving the button with no fill.
Pass the web app’s CSS @theme block to <Tailwind>’s config prop so the same OKLCH tokens are reused without duplication.
Nothing — <Tailwind> converts OKLCH to a client-safe color space automatically at render time.

A teammate inlines the logo as a base64 data URL so there’s “nothing to host.” Beyond the image possibly not appearing, what’s the more serious consequence?

The encoded bytes can push the message past Gmail’s 102 KB limit, which clips it — hiding everything after the cut, including the footer’s unsubscribe link and legal address, behind a link most people never tap.
Base64 images break the auto-generated plain-text part, so the message ships HTML-only and fails spam filters.
Inline images force Outlook to render at natural size, blowing past the 600px column.

Which lines belong inside a WelcomeEmail template, and which belong in the Server Action that calls it? Select every statement that’s correct.

Reading firstName and verifyUrl from props belongs inside the template — it’s pure presentation.
Building verifyUrl from process.env.APP_URL and a token belongs in the Server Action, not the template.
The template should query the database for the user record when only an id is passed, to keep the call site simple.
Keeping the template props-only is what lets the same file render unchanged in the preview, in a test, and in a real send.

The preview server’s dark-mode toggle shows your template looking clean in dark mode. What can you correctly conclude?

That the obviously-broken cases are caught, but not that dark mode is correct everywhere — the toggle only emulates prefers-color-scheme: dark and can’t reproduce Gmail Android’s blanket inversion. Confirm with a real test-send.
That the email is confirmed correct in dark mode on every client, since the toggle renders the same way real clients do.
Nothing useful — the toggle is purely decorative and should be ignored in favor of the test-send.

You’re about to declare a template done. Order matters: which check sits last in the loop, and why isn’t it just another preview pass?

A test-send to real inboxes you actually open — it’s the only thing that reveals what a real client does (dark-mode inversion, the Outlook VML button path) that no local render can fake.
Toggling the mobile viewport — once it wraps cleanly at 375px, every other client follows.
Reading the HTML view to confirm the <Tailwind> classes inlined — once the styles are on the wire, rendering is guaranteed.
Editing PreviewProps to a long name and URL to stress the layout — the worst-case render proves the rest.

The Resend SDK auto-derives the text/plain body from the react node you send. Given that, what’s the correct working habit for the plain-text version?

Read it in the preview’s plain-text tab as a standalone message, and fix any incoherence in the HTML JSX — there’s no separate text file, the text is downstream of the JSX.
Hand-write a parallel text string for every send so you control exactly what plain-text readers see.
Call render(<T/>, { plainText: true }) on the send path to guarantee the text part is generated.

The plain-text tab shows the decorative sparkle image’s filename leaking in as a stray line above the greeting. What’s the right fix, and what’s the trap?

Set the decorative image’s alt to an explicit empty string — that drops it from the text. The trap is doing the same to an informational image, which silences real content for screen-reader users.
Delete the offending line directly in the generated text body — it’s faster than touching the JSX.
Shrink the image with smaller width/height so the generator emits less text for it.

You ship a CTA whose text only clears 4.5:1 contrast after a client applies your @media (prefers-color-scheme: dark) styles. In its light form it sits at 3:1. Is the template accessible enough to ship?

No — the light template must meet WCAG contrast on its own. Most clients ignore the dark preference (and some Gmail clients strip <style> blocks), so dark mode is a courtesy layer, never the contrast strategy.
Yes — as long as the message clears 4.5:1 in some rendering, it satisfies WCAG AA for that text.
Yes, provided the color-scheme meta tags are present so the dark styles are guaranteed to apply.

You add Tailwind dark: utilities to your CTA but put nothing else in <Head>. A user opens it in Apple Mail with the OS set to dark. What happens?

The dark styling is ignored — Apple Mail only applies your dark styles once the template declares it’s dark-aware via the color-scheme and supported-color-schemes meta tags. The plumbing is the opt-in.
Apple Mail applies the dark: styles automatically, because it always honors prefers-color-scheme.
Apple Mail fully inverts the whole message regardless, so the dark: styles are redundant.

Quiz complete

Score by topic