Skip to content

feat: same titles for sent email groups#259

Merged
arbrandes merged 11 commits into
openedx:masterfrom
raccoongang:romaniuk/different-titles-for-email-groups
Apr 17, 2026
Merged

feat: same titles for sent email groups#259
arbrandes merged 11 commits into
openedx:masterfrom
raccoongang:romaniuk/different-titles-for-email-groups

Conversation

@ihor-romaniuk

Copy link
Copy Markdown
Contributor

Reopened Pull Request based on #205

Description

this PR proposes making the display of mail recipients the same for all places (checkbox labels, Send email alert modal, Scheduled emails table with View Modal, Email Task History)

Steps to reproduce

click on "Staff/Administrators" checkbox -> complete the form (subject, body) -> options:

  • to see recipients titles in "Caution" modal, click on "Send email" button
  • same if you schedule day and time and click on "Schedule email" button
    (in this modal you can see the difference between recipients titles and selected checkbox label)

-> click "Continue" button -> wait for the "Scheduled emails" table to load and also compare titles in "Send to" column

Screenshots before

Example with selected "Staff/Administrators"

image image image

Example with selected "All Learners"

image image image

Screenshots after

image image
image image image

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Oct 13, 2025
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @ihor-romaniuk!

This repository is currently maintained by @openedx/committers-frontend.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Oct 13, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.29%. Comparing base (0c2cf95) to head (637b9cf).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #259      +/-   ##
==========================================
+ Coverage   84.14%   84.29%   +0.15%     
==========================================
  Files          47       50       +3     
  Lines         700      707       +7     
  Branches      135      136       +1     
==========================================
+ Hits          589      596       +7     
  Misses        111      111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Oct 15, 2025
@ihor-romaniuk ihor-romaniuk removed the request for review from Inferato October 28, 2025 20:07

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have not tested this but the code LGTM.

I left one comment with a question about a CSS class being added.

</div>
<div className="d-flex flex-row">
<p>{intl.formatMessage(messages.modalMessageSentTo)}</p>
<p className="flex-shrink-0">{intl.formatMessage(messages.modalMessageSentTo)}</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see anything in the PR description about this change. Could you explain why this change is needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have re-checked it and we can revert this class. Thanks
image

@ihor-romaniuk ihor-romaniuk added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Nov 28, 2025
@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/different-titles-for-email-groups branch from 9ad4092 to 323af89 Compare December 2, 2025 11:34
@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@peterkulko peterkulko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ihor-romaniuk thanks for the PR! I left a minor comment and one question about the package-lock.json changes.

Comment thread src/components/bulk-email-tool/utils.js Outdated
* @returns {string} - The formatted display name for the recipient,
* or the original recipient key if no display name is found.
*/
// eslint-disable-next-line import/prefer-default-export

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[optional]: We could export RECIPIENTS_DISPLAY_NAMES from this file to avoid disabling the import/prefer-default-export eslint rule.
Alternatively, we could move RECIPIENTS_DISPLAY_NAMES to a constants file since it’s a constant, and keep the rule disabled.

@ihor-romaniuk ihor-romaniuk Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done - I exported RECIPIENTS_DISPLAY_NAMES from this file and removed the import/prefer-default-export disable since it’s no longer needed. Thank you.

Comment thread package-lock.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[important]: Why do we have these changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep - those changes were required. I only updated package-lock.json because it was out of date, and the PR checks were failing because of it. No functional changes intended there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have reverted changes refarding the package-lock.json file because we have already merged commit in master branch 4a34632

@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove

Copy link
Copy Markdown

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@mphilbrick211 mphilbrick211 moved this from Ready for Review to In Eng Review in Contributions Jan 22, 2026

@peterkulko peterkulko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@arbrandes arbrandes linked an issue Feb 12, 2026 that may be closed by this pull request
@kdmccormick kdmccormick removed the create-sandbox open-craft-grove should create a sandbox environment from this PR label Mar 16, 2026
@kdmccormick

Copy link
Copy Markdown
Member

I've deleted this PR's sandbox but feel free to create it by adding the create-sandbox label again.

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, some stuff Claude caught that I agree warrants addressing. Only the first one is an actual bug, though:

ViewEmailModal for scheduled emails still shows raw identifiers

In BulkEmailScheduledEmailsTable.jsx, the handleViewEmail function passes row.original.targets to the ViewEmailModal:

sent_to: row.original.targets,

targets is the raw joined string (e.g., "learners" or "staff"), not the display-friendly targetsText (e.g., "All learners" or "Staff and instructors"). The table column was correctly switched to use targetsText at line 160, but the View modal was missed.

This means: clicking "View" on a scheduled email will display "learners" in the "Sent to" field while the table row next to it says "All learners". This partially defeats the PR's purpose of making display names consistent across all views.

The fix is straightforward - use targetsText instead of targets on that line.

Changed i18n message IDs for "Myself" label

The "Myself" label text didn't change, but its message ID was renamed from bulk.email.form.recipients.myself to bulk.email.recipients.myself.label. This means any existing translations for that string will be lost and fall back to the English default until re-translated.

For "Staff/Administrators" and "All Learners", new IDs make sense since the English text actually changed. For "Myself", keeping the old message ID (or extracting it to the shared file under the same ID) would preserve existing translations.

This may or may not matter depending on how actively translations are maintained for this MFE, but it's worth being aware of.

Nit: unclear variable name

In BulkEmailScheduledEmailsTable.jsx line 33:

targetsText: email.courseEmail.targets.map((mess) => getDisplayTextFromRecipient(intl, mess)).join(', '),

The parameter mess reads like it might mean "message", but these items are recipient identifiers. Something like recipient or target would be clearer.

@ihor-romaniuk

ihor-romaniuk commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Ok, some stuff Claude caught that I agree warrants addressing. Only the first one is an actual bug, though:

ViewEmailModal for scheduled emails still shows raw identifiers

In BulkEmailScheduledEmailsTable.jsx, the handleViewEmail function passes row.original.targets to the ViewEmailModal:

sent_to: row.original.targets,

targets is the raw joined string (e.g., "learners" or "staff"), not the display-friendly targetsText (e.g., "All learners" or "Staff and instructors"). The table column was correctly switched to use targetsText at line 160, but the View modal was missed.

This means: clicking "View" on a scheduled email will display "learners" in the "Sent to" field while the table row next to it says "All learners". This partially defeats the PR's purpose of making display names consistent across all views.

The fix is straightforward - use targetsText instead of targets on that line.

Changed i18n message IDs for "Myself" label

The "Myself" label text didn't change, but its message ID was renamed from bulk.email.form.recipients.myself to bulk.email.recipients.myself.label. This means any existing translations for that string will be lost and fall back to the English default until re-translated.

For "Staff/Administrators" and "All Learners", new IDs make sense since the English text actually changed. For "Myself", keeping the old message ID (or extracting it to the shared file under the same ID) would preserve existing translations.

This may or may not matter depending on how actively translations are maintained for this MFE, but it's worth being aware of.

Nit: unclear variable name

In BulkEmailScheduledEmailsTable.jsx line 33:

targetsText: email.courseEmail.targets.map((mess) => getDisplayTextFromRecipient(intl, mess)).join(', '),

The parameter mess reads like it might mean "message", but these items are recipient identifiers. Something like recipient or target would be clearer.

@arbrandes Thanks for the review! All three items are addressed in the latest commit:

  • ViewEmailModal bug - fixed sent_to to use targetsText instead of raw targets, so the View modal now shows the same display-friendly names as the table.
  • "Myself" i18n ID - restored the original bulk.email.form.recipients.myself message ID to preserve existing translations (since the default text didn't change).
  • Variable naming - renamed mess to recipient for clarity.

Please re-check when you get a chance, and go forward if everything looks good.

@ihor-romaniuk ihor-romaniuk requested a review from arbrandes April 16, 2026 07:30
@arbrandes

Copy link
Copy Markdown
Contributor

@ihor-romaniuk, almost there! All issues address, thank you - but package-lock.json is out of sync with package.json, so npm ci doesn't work. Mind fixing it up?

Kyrylo Hudym-Levkovych and others added 10 commits April 17, 2026 13:56
Co-authored-by: Braden MacDonald <mail@bradenm.com>
- Use targetsText in ViewEmailModal so scheduled emails show
  display-friendly names instead of raw identifiers
- Restore original i18n message ID for "Myself" to preserve
  existing translations
- Rename unclear `mess` parameter to `recipient`
@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/different-titles-for-email-groups branch from 7b859d9 to 40adfae Compare April 17, 2026 12:02
@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/different-titles-for-email-groups branch from 40adfae to 637b9cf Compare April 17, 2026 12:06
@ihor-romaniuk

Copy link
Copy Markdown
Contributor Author

@arbrandes it looks like the package-lock file was not updated to use node 24.

I've rebuild the package-lock.json file and now all CI checkers pass.

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great, thanks!

@arbrandes arbrandes merged commit 3b7dfbc into openedx:master Apr 17, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Apr 17, 2026
@ihor-romaniuk ihor-romaniuk deleted the romaniuk/different-titles-for-email-groups branch April 20, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Same titles for sent email groups

8 participants