Skip to content

v5.2.6

@markvaneijk markvaneijk tagged this 08 Sep 09:52
Filament runs formatStateUsing() once per item when a column or entry
resolves to an array, then implodes the results. The recipient fields
ignored the per-item $state and formatted the whole $record->to array on
every pass, so a mail to two recipients rendered the full list twice:
"a@b.c, d@e.f, a@b.c, d@e.f".

Resolve the array through getStateUsing() instead, so the addresses are
joined into a single string before Filament decides whether the state is
a list. Applied to the "to" table column and to the from/to/cc/bcc/
reply_to entries in the infolist, which had the same duplication in the
view modal.

Two knock-on effects: from/to now guard against null like the other
fields, where formatMailState(array) would have thrown a TypeError, and
->default('-') on cc/bcc/reply_to finally takes effect, because the empty
result is now blank() at the point Filament applies the default instead
of being discarded by the formatter.

Fixes backstagephp/mails#88

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assets 2
Loading