Badsender-com / LePatron.email

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.
https://www.lepatron.email
GNU General Public License v3.0
73 stars 12 forks source link

WIP: Feature: Filter Personalized Blocks by Template Origin Using Mailing ID #727

Closed omar-bear closed 1 year ago

omar-bear commented 1 year ago

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:
  1. 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.
  2. 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.
  3. Add templateId to Personalized Block Schema

    • File: personalized-block-schema.js
    • Task:
      • Add templateId to the schema definition for personalized blocks.
Frontend:
  1. 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.
  2. 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.
  3. Update Create Logic in Save Block Modal Component

    • File: packages/editor/src/js/vue/components/save-block-modal/save-modal.js
    • Task:
      • 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.)
  4. Handle Empty States

    • Display a message "No personalized blocks available for this template" if no blocks are available for the current template.

Acceptance Criteria:

Time Estimate:

1 days

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
4.0% 4.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint