LePatron is an opensource email builder allowing to industrialize your email template production. Build tailor made email templates and make them available to your non-technical users.
Feature: Filter Personalized Blocks by Template Origin Using Mailing ID
Description:
The objective of this feature is to solve the issue related to adding personalized blocks from one template (Template A) into an email based on another template (Template B). The solution aims to filter the personalized blocks according to the current template being used in the email.
Implementation Details:
Backend:
Utilize Existing API Endpoint for Fetching Mail Information
Note: An existing API endpoint that takes mailingId as a parameter returns detailed mail information, including the templateId.
Extend API to Include Template-based Filtering
File: personalized-block-service.js
Task:
Add a query parameter templateId in the getPersonalizedBlocks method.
Implement logic to filter blocks based on the templateId.
Add templateId to Personalized Block Schema
File: personalized-block-schema.js
Task:
Add templateId to the schema definition for personalized blocks.
Frontend:
Create badsender-current-mailing Extension
The extension will fetch detailed mail information using the current mailingId and update the ViewModel.
The ViewModel will include a new property, currentMailing, which will be an observable object containing all the mail information.
Integrate Filtering Logic in Personalized Blocks List Component
Modify the fetchPersonalizedBlocks method to include the templateId from currentMailing as a parameter during the API call to getPersonalizedBlocks.
When creating a personalized block, pass the templateId from currentMailing to the relevant API endpoint. (Note: Updating a personalized block will not require sending the templateId again.)
Handle Empty States
Display a message "No personalized blocks available for this template" if no blocks are available for the current template.
Acceptance Criteria:
All the detailed mail information, including templateId, is successfully fetched and stored in the ViewModel under the currentMailing property.
The filter functions as expected, displaying only the blocks corresponding to the current template.
The templateId is successfully passed when creating personalized blocks.
An appropriate message is displayed when no blocks are available for the current template.
Feature: Filter Personalized Blocks by Template Origin Using Mailing ID
Description:
The objective of this feature is to solve the issue related to adding personalized blocks from one template (Template A) into an email based on another template (Template B). The solution aims to filter the personalized blocks according to the current template being used in the email.
Implementation Details:
Backend:
Utilize Existing API Endpoint for Fetching Mail Information
mailingId
as a parameter returns detailed mail information, including thetemplateId
.Extend API to Include Template-based Filtering
personalized-block-service.js
templateId
in thegetPersonalizedBlocks
method.templateId
.Add
templateId
to Personalized Block Schemapersonalized-block-schema.js
templateId
to the schema definition for personalized blocks.Frontend:
Create
badsender-current-mailing
ExtensionmailingId
and update the ViewModel.currentMailing
, which will be an observable object containing all the mail information.Integrate Filtering Logic in Personalized Blocks List Component
fetchPersonalizedBlocks
method to include thetemplateId
fromcurrentMailing
as a parameter during the API call togetPersonalizedBlocks
.Update Create Logic in Save Block Modal Component
packages/editor/src/js/vue/components/save-block-modal/save-modal.js
templateId
fromcurrentMailing
to the relevant API endpoint. (Note: Updating a personalized block will not require sending thetemplateId
again.)Handle Empty States
Acceptance Criteria:
templateId
, is successfully fetched and stored in the ViewModel under thecurrentMailing
property.templateId
is successfully passed when creating personalized blocks.Time Estimate:
1 days
https://github.com/Badsender-com/LePatron.email/assets/80390318/4f8c1ae4-5087-4d93-9ca8-3f467357e286