Template versioning tracks breaking changes
Why it matters
Jobs that reference a template by mutable name always resolve to the current version. When a template is updated mid-campaign, queued jobs that have not yet been processed will render the new version instead of the version that was live when the campaign was dispatched. Recipients in the same send batch receive different content depending on when their job was processed. ISO-25010:2011 maintainability.modifiability requires that changes to one component do not silently alter the behavior of unrelated queued work.
Severity rationale
Low because mid-campaign template mutations affect content consistency rather than causing data loss, security exposure, or system failure.
Remediation
Pin a templateVersion identifier on every job at enqueue time so the worker loads the exact version that was current when the campaign was dispatched:
await emailQueue.add('send', {
to: recipient.email,
templateId: 'welcome',
templateVersion: 'v2.1.0', // Pinned at dispatch time
mergeFields: { firstName: recipient.firstName }
})
In the worker, query db.emailTemplate.findFirstOrThrow({ where: { slug: templateId, version: templateVersion } }) so a template update never silently alters in-flight jobs.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Sending Pipeline & Infrastructure Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.modifiability — Modifiability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from sending-pipeline-infrastructure·automated