Skip to content

Newsletters 0.1.13: Retry a failed broadcast

Newsletters 0.1.13 lets you send a failed broadcast again once you have fixed what stopped it, instead of creating it anew.

Retry send

A broadcast’s details page now shows Retry send when the broadcast has failed. Today the only cause is a scheduled send whose CRM list was archived. The retry checks the audience again the same way a first send does, so retrying while the list is still archived fails the same way and the broadcast stays failed.

The retry reads the broadcast fresh before sending. A click from a tab left open since the broadcast was retried elsewhere is refused and the page refreshes to show the real status, so a broadcast that is already sending or sent is not started again.

Readable errors

Send now in the broadcast editor showed a refused send as raw technical output. Both the editor and the details page now show the same plain sentences. The retry button, its confirmation and the send error messages are translated into Estonian and Russian.

Full release notes: Newsletters 0.1.13

0.1.13 · 31 July 2026

Added

  • A broadcast that failed terminally — the only cause today is a scheduled send whose CRM list was archived — can be sent again from its details page once the cause is fixed. Broadcaster.send/1 accepts "failed" alongside "draft"/"scheduled" and re-runs the same recipient-source validation, so a retry against a still-archived list fails the same way and the broadcast stays "failed".

Fixed

  • The retry re-reads the broadcast before sending. It previously sent the copy the page loaded, so a click from a tab left open since the broadcast was retried elsewhere passed a stale "failed" status through Broadcaster.send/1‘s guard — dragging an already-sending (or already-sent) broadcast back into "sending", overwriting sent_at, and mailing anyone added to the audience in the meantime. A refusal now also refreshes the page, so the operator ends up looking at the broadcast’s real status.
  • “Send now” in the broadcast editor renders Broadcaster.send/1‘s refusals as sentences instead of raw Elixir tuples, matching the details page. Both now share Web.SendError.message/1, so the two surfaces can’t drift.
  • The retry button, its confirmation, and the send-error messages are translated. They shipped as untranslated gettext calls missing from every catalogue, so Estonian and Russian operators saw raw English with nothing to flag it; "Edit send profile" was likewise blank in the en catalogue. The i18n test now fails on any msgid that is in default.pot but missing — or untranslated — in a locale.

Added

  • Broadcasts can now carry file attachments. The editor gets a media picker (core Storage), removable chips showing each file’s name and size, a non-blocking warning once the attachments total more than 7 MB, and a visible “missing file” chip for a file deleted from Storage after it was attached — so a stale reference can still be removed rather than silently riding along. Up to 10 distinct files per broadcast, attached in the order they were picked; the broadcast details page shows the same list read-only. Requires core >= 1.7.211 (V158).
  • DeliveryWorker attaches those files to every delivery, on both the send-profile and legacy paths. A file that can’t be read (deleted row, missing original variant, object unreachable in every bucket) is logged and skipped rather than failing the send — a broadcast with nine good attachments and one broken one still reaches every recipient with the nine.

Fixed

  • Attachment downloads are now genuinely shared across a broadcast’s delivery jobs. The cache backing them was an ETS table created inside perform/1, so it was owned by whichever Oban job touched it first and was destroyed the moment that job finished — every recipient re-downloaded every attachment, and a job whose :ets.lookup landed just after the owner exited crashed with ArgumentError. The table is now owned by a supervised process (PhoenixKit.Newsletters.AttachmentCache, started by the package’s new application module) for the lifetime of the node.
  • Cached attachments are swept on a timer instead of only when something reads them again. Nothing re-reads a finished broadcast’s attachments, so their bytes previously stayed resident for the life of the node; memory is now bounded by what was actually sent in the last two minutes.
  • The editor’s media picker now enforces the same 10-file cap the changeset does (Broadcast.max_attachments/0), instead of letting a larger selection through to fail as a validation error at save time.
  • DeliveryWorker message-id extraction now matches Amazon SES over SMTP receipts. The pattern added in 0.1.11 was anchored on a literal 250 , which gen_smtp strips before returning the receipt ({ok, <<"250 ", Receipt/binary>>} -> Receipt), so it never matched a real send and SES message ids were silently dropped. Receipts that do still carry the status code keep working.

Newsletters 0.1.13. Install or update: {:phoenix_kit_newsletters, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.