Skip to content

Email log To field shows PHP serialized data when a send has several recipients #433

Description

@robertstaddon

When WordPress hands FluentSMTP a message with several To addresses (Gravity Forms notifications, WooCommerce order emails, woocommerce_email_recipient_* filters, etc.), the Email Log viewer prints a PHP serialized blob instead of the addresses:

a:7:{i:0;a:1:{s:5:"email";s:19:"ryan@example.com";}i:1;a:1:{s:5:"email";s:24:"mackenzie@example.com";}...

Sending itself succeeds. The log To column, and resend from that row, do not.

Root cause

FluentSMTP stores recipients as a PHP-serialized array of {email, name} rows in fsmpt_email_logs.to, which is VARCHAR(255).

A serialized list of four typical addresses still fits. Five or more is clipped by MySQL. WordPress is_serialized() then rejects the truncated string (it no longer ends in }), so the admin UI renders the raw blob. Resend foreaches that string instead of an address list.

This is the same failure as #366 and #132; those reports described it as JSON / a WooCommerce-only break. It is the column width, and it shows up for any plugin that puts several addresses in wp_mail()'s $to argument. Gravity Forms notifications with a comma-separated Send To list are one example.

Steps to reproduce

  1. Enable email logging.
  2. Send a message to 5+ addresses in a single wp_mail() To (a Gravity Forms notification with several Send To emails is enough).
  3. Open Email Logs and view the row.

Expected: a@example.com, b@example.com, ...
Actual: a truncated a:7:{i:0;a:1:{s:5:"email";... string.

A send to four of the same addresses still displays correctly, which is why this looks intermittent.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions