Skip to content

SparkPost: send plain-text emails as text, not HTML - #438

Open
JiveDig wants to merge 1 commit into
WPManageNinja:masterfrom
JiveDig:fix/sparkpost-plain-text
Open

JiveDig wants to merge 1 commit into
WPManageNinja:masterfrom
JiveDig:fix/sparkpost-plain-text

Conversation

@JiveDig

@JiveDig JiveDig commented Sep 23, 2026

Copy link
Copy Markdown

The SparkPost handler always sends the message body as content.html, even when the email is plain text. Mail clients then render the plain text as HTML, so every line break collapses and the message runs together on one line.

This sends a text/plain message as content.text only, the same way the Brevo handler already does (Providers/SendInBlue/Handler.php). HTML and multipart messages are unchanged.

Tested: I sent the same plain-text message through SparkPost's transmissions API with the payload before and after this change. Before, it arrived as one line. After, the line breaks were intact. FluentSMTP 2.4.0, WordPress 7.1, PHP 8.4.

The SparkPost handler always sent the body as content.html, so a plain-text email's line breaks collapsed in mail clients. A text/plain message now goes out as content.text only, as the Brevo handler already does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant