payloadcms / payloadcms/payload

Form Builder Plugin wraps <table> in <p> tag when sending submission email

Open
#14,328 0 comments 0 reactions 1 assignee View on GitHub

@paulpopus is already working on this.

Since Oct 24, 2025.

Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

It appears that the form builder plugin wraps the <table> generated in form submission emails with <p> tags.
As per: http://www.w3.org/TR/html401/struct/text.html#h-9.3.1

The P element represents a paragraph. It cannot contain block-level elements (including P itself).

This breaks more complex email styling.

Link to the code that reproduces this issue

https://github.com/stuible/payload-form-issue-reproduction

Reproduction Steps
  1. Create a form and include {{*:table}} in the submission email message.
  2. Configure the node mailer to send email
  3. Submit a new form
  4. See that the table included in the email body is wrapped in a <p> tag
Which area(s) are affected? (Select all that apply)

plugin: form-builder

Environment Info
Binaries:
  Node: 20.19.4
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.12.1
Relevant Packages:
  payload: 3.61.0
  next: 15.4.4
  @payloadcms/db-sqlite: 3.61.0
  @payloadcms/drizzle: 3.61.0
  @payloadcms/email-nodemailer: 3.61.0
  @payloadcms/graphql: 3.61.0
  @payloadcms/next/utilities: 3.61.0
  @payloadcms/payload-cloud: 3.61.0
  @payloadcms/plugin-form-builder: 3.61.0
  @payloadcms/richtext-lexical: 3.61.0
  @payloadcms/translations: 3.61.0
  @payloadcms/ui/shared: 3.61.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:35:32 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.