Improve extension email template placeholders - #2970
Conversation
RabbiIslamRony
left a comment
There was a problem hiding this comment.
Thanks for the update. Requesting changes before merge:
-
Please explicitly mention and link the dependency on sovware/directorist-pricing-plans-new#104. With this core PR alone and the released Pricing Plans 4.0.1.1, no Pricing Plan email events are registered, so both PRs must be tested and released together.
-
Please show only placeholders supported by each specific email event. On the paired PR heads, the Subscription Activated modal offered ==LISTING_TITLE== and ==CANCELLED_DATE==, but a captured email left both tokens unresolved. Scraping a shared field description and combining it with the global core list is not reliable; please use explicit per-event placeholder metadata shared with the mailer.
-
Please re-test the complete flow with both PRs and ensure the required Pricing Plans CI passes.
Once these are addressed, the updated heads can be revalidated locally.
|
Updated both heads for the requested changes. Directorist PR #2970:
Pricing Plans PR #104:
Verification run locally:
Note on the Pricing Plans required PHPCS check: the current GitHub workflow is still failing, but the latest run checks out |
RabbiIslamRony
left a comment
There was a problem hiding this comment.
Thanks for the update. The event-specific placeholder metadata fixes the reported Pricing Plans issue in the normal flows, and the dependency on Pricing Plans PR #104 is now documented. However, two release-blocking cases remain:
-
Existing extension events without explicit
placeholdersmetadata now return an empty list becausetemplateOnlyevents fall back to[]. Directorist Booking currently uses this legacy contract, so its email modals regress from 18 available placeholder buttons to none. Please use explicit event metadata when present, but preserve the legacy fallback for extensions that have not migrated yet. -
Pricing Plans advertises
{{expiry_date}}forpackage-activated, whilePackageMaileronly supplies that value whencurrent_period_endexists. A valid lifetime package has a null end date, and the outgoing email therefore retains the literal{{expiry_date}}. Please always provide a replacement value for this advertised token, including the lifetime-package path.
Because this PR is intended to be released together with Pricing Plans PR #104, both cases need to be resolved and revalidated before merge.
PR Type
What kind of change does this PR introduce?
Description
How to reproduce the issue or how to test the changes
This updates the redesigned Directorist notification editor so extension-provided email template events can expose explicit per-event placeholders.
Pricing Plans registers package/subscription email template sections through the existing
atbdp_email_templates_settings_sectionsfilter. The editor must use explicit placeholder metadata from those extension events instead of combining a shared/global placeholder list with placeholders scraped from field descriptions/default values.Changes included:
placeholders,template_placeholders,supported_placeholders, andsupportedPlaceholders.Dependency:
Testing:
Directorist -> Settings -> Email Settings -> Email Events.==LISTING_TITLE==or{{cancelled_date}}.==PLAN_NAME=={{next_billing_amount}}Verification:
git diff --checkpassed.Any linked issues
Support ticket: https://team.sovware.com/support/cmsbripa300bwyps6tzg5ocsq
Depends on Pricing Plans PR #104.
Screenshot
N/A
Checklist