fix(notifications): deliver the authored body_html #475
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-700-dispatch-body-html"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
dispatchselectednotification_templates.body_htmland never read it, and the worker'sdeliveronly ever called the plain-text send, so every dispatcher-delivered email went out single-part plain text and each seededbody_htmlwas dead weight. The same two messages existed a second time as hard-codedMailer::send_password_reset/Mailer::send_welcomebodies that DID sendmultipart/alternative, so which document a recipient got depended on whether the dispatcher was wired.Mailernow has one send primitive,send_multipart(to, subject, text, html), withsend_textas a plain-text wrapper over it;SmtpMailerbuilds the message through a freebuild_messagehelper so the shape is unit-testable without a transport. The two hard-coded template copies are gone. Migration 097 addsnotifications.body_html;dispatchrenders the template's HTML into it alongside the text (inside the same resolution pass, so the two parts cannot disagree) and the worker reads it back and hands it tosend_multipart.The portal contact setup mail was the third path: it called
send_welcomedirectly, so it got HTML but no retries. It now dispatchesauth.welcomelike the staff welcome mail, which makes the dispatcher the only delivery path for both. Because there is no direct-send fallback left, theauth.password_reset/auth.welcomerows have to exist everywhere: migration 097 backfills them into existing tenants andcopy_default_configcopies them for new ones (they were default-tenant only before).scripts/check-no-duplicate-mail-copy.nufails the build if a seeded template's wording reappears undersrc/, so the duplicate copy cannot come back silently. Wired intojust checkand check.yml.#PMS-700