From 7b853cbd4a8ed80fe2676ca972c1937c27701476 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Mon, 6 Oct 2025 23:20:56 +0200 Subject: [PATCH] Fix template population in beforeSend hook and bump version to 0.4.16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added depth parameter to findByID call in processEmailItem to ensure template relationship is populated when passed to beforeSend hook. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package.json | 2 +- src/services/MailingService.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 87d3cba..cd1ce08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xtr-dev/payload-mailing", - "version": "0.4.15", + "version": "0.4.16", "description": "Template-based email system with scheduling and job processing for PayloadCMS", "type": "module", "main": "dist/index.js", diff --git a/src/services/MailingService.ts b/src/services/MailingService.ts index dbdcb1d..d940172 100644 --- a/src/services/MailingService.ts +++ b/src/services/MailingService.ts @@ -233,6 +233,7 @@ export class MailingService implements IMailingService { const email = await this.payload.findByID({ collection: this.emailsCollection as any, id: emailId, + depth: 1, }) as BaseEmailDocument // Combine from and fromName for nodemailer using proper sanitization