Skip to content

Feature pressynced 2954 add email template and email layout interception points#1739

Open
john5onCheng wants to merge 2 commits intopixl8:stablefrom
john5onCheng:feature-PRESSYNCED-2954_add_email_template_and_email_layout_interception_points
Open

Feature pressynced 2954 add email template and email layout interception points#1739
john5onCheng wants to merge 2 commits intopixl8:stablefrom
john5onCheng:feature-PRESSYNCED-2954_add_email_template_and_email_layout_interception_points

Conversation

@john5onCheng
Copy link
Contributor

@john5onCheng john5onCheng commented Feb 3, 2026

Note

Medium Risk
Low-touch changes but they alter email rendering/config return values via interceptor mutation and adjust cache key behavior, which could affect output consistency across templates/layouts.

Overview
Adds two new extension hooks to the email system by registering prePrepareEmailHtmlContent and postGetLayoutConfig as custom interception points.

EmailTemplateService._prepareHtml() now announces prePrepareEmailHtmlContent before caching/rendering, and EmailLayoutService.getLayoutConfig() now announces postGetLayoutConfig and returns the potentially mutated config from interceptors (instead of the locally built struct).

Written by Cursor Bugbot for commit 126855a. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

var cacheKey = ( $helpers.isTrue( arguments.useDefaultContent ?: "" ) ? "default" : "saved" ) & "rawhtml" & arguments.template;
$announceInterception( "prePrepareEmailHtmlContent", arguments );

var cacheKey = arguments.cacheSuffix ?: ( $helpers.isTrue( arguments.useDefaultContent ?: "" ) ? "default" : "saved" ) & "rawhtml" & arguments.template;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty cache key causes all emails to share cache

High Severity

The Elvis operator (?:) only checks for null, not empty strings. Since cacheSuffix defaults to "" (line 1620), the expression arguments.cacheSuffix ?: (...) evaluates to "" instead of the fallback cache key calculation. This causes all email templates without an explicit cacheSuffix to share the same empty string cache key, resulting in the first rendered email being returned for all subsequent emails. The original logic constructed unique keys per template, but this change breaks that behavior.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant