Skip to content

Pro issue 6020 email style tracking#2532

Merged
Crabcyborg merged 2 commits into
masterfrom
pro-issue-6020-email-style-tracking
Oct 7, 2025
Merged

Pro issue 6020 email style tracking#2532
Crabcyborg merged 2 commits into
masterfrom
pro-issue-6020-email-style-tracking

Conversation

@truongwp
Copy link
Copy Markdown
Contributor

@truongwp truongwp commented Oct 7, 2025

This PR adds this data to the snapshot:

  • 'email_style' in 'settings'.
  • Number of times send test email is used for each style, this is in the flows table:
'send_test_email' => array(
    'classic' => 2,
    'modern'  => 5,
    ...
)

Related issue: https://github.com/Strategy11/formidable-pro/issues/6020

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 7, 2025

Walkthrough

Adds flow-tracking update during test email send and includes email_style in usage settings snapshot. No public signatures changed.

Changes

Cohort / File(s) Summary of Changes
Email test flow tracking
classes/controllers/FrmEmailStylesController.php
In ajax_send_test_email, calls FrmUsageController::update_flows_data('send_test_email', $email_style) before sending, adding side-effect tracking.
Usage settings snapshot
classes/models/FrmUsage.php
Adds email_style to $pass_settings in settings(), ensuring it’s processed (via maybe_json) and included in usage data.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as Admin UI
  participant C as FrmEmailStylesController
  participant UC as FrmUsageController
  participant M as Mailer

  U->>C: ajax_send_test_email(payload)
  C->>C: Validate input & build email
  C->>UC: update_flows_data('send_test_email', email_style)
  UC-->>C: ack
  C->>M: send(email)
  alt send success
    M-->>C: success
    C-->>U: JSON { success: true }
  else send failure
    M-->>C: error
    C-->>U: JSON { success: false, error }
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Track gdpr settings #2300 — Also modifies FrmUsage::settings() by adding keys to the $pass_settings array (GDPR-related), touching the same code path.

Suggested labels

run tests

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title directly references tracking of email styles, which is the core change introduced by the PR, and the included issue reference does not obscure the primary focus on email style tracking. It succinctly conveys the main enhancement without listing implementation details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed The pull request description clearly outlines the addition of 'email_style' to the settings snapshot and the tracking of send test email usage counts per style, which directly corresponds to the implemented changes and the stated objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pro-issue-6020-email-style-tracking

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@truongwp truongwp requested a review from Crabcyborg October 7, 2025 15:47
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg left a comment

Choose a reason for hiding this comment

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

Thanks @truongwp!

@Crabcyborg Crabcyborg added this to the 6.25 milestone Oct 7, 2025
@Crabcyborg Crabcyborg merged commit 92cd3ba into master Oct 7, 2025
36 checks passed
@Crabcyborg Crabcyborg deleted the pro-issue-6020-email-style-tracking branch October 7, 2025 17:09
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…racking

Pro issue 6020 email style tracking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants