Skip to content

Personalized Name String in E-mails#449

Merged
cubap merged 4 commits into
developmentfrom
names-in-emails
Feb 18, 2026
Merged

Personalized Name String in E-mails#449
cubap merged 4 commits into
developmentfrom
names-in-emails

Conversation

@thehabes
Copy link
Copy Markdown
Member

@thehabes thehabes commented Feb 18, 2026

Closes CenterForDigitalHumanities/TPEN-interfaces#459

Summary

  • Replace the hardcoded "TPEN User" greeting in email templates with the recipient's actual display name or email local part
  • Add JSDoc documentation to the sendMail() utility function
  • Remove .claude/ configuration files that should not be committed

Details

All emails sent by TPEN Services used a generic "Hello TPEN User" greeting, making them look impersonal and untrustworthy. Both email paths (invitation and removal/departure) already had access to user data at the point of sending but never passed it through.

Changes:

  • utilities/mailer/index.js — Added optional userName parameter to sendMail() with fallback: passed name → email local part. Added JSDoc.
  • classes/Project/Project.js — Updated both sendMail() call sites:
    • sendInvite(): resolves name from the user lookup already performed via getByEmail()
    • removeMember(): resolves name from userData already fetched via getSelf()

The signature change is backwards-compatible — callers without the 4th argument continue to work with the email local part as the greeting.

Test plan

  • npm run existsTests — all 66 tests pass
  • npm run unitTests — all non-database tests pass (MongoDB timeouts expected without a running database)
  • Verify invitation email shows recipient's display name in greeting
  • Verify removal email shows recipient's display name in greeting
  • Verify new user invitation falls back to email local part (e.g., "Hello jane" for jane@example.com)

@thehabes thehabes self-assigned this Feb 18, 2026
@thehabes thehabes changed the title Personalized Name Strings in E-mails Personalized Name String in E-mails Feb 18, 2026
@thehabes thehabes marked this pull request as ready for review February 18, 2026 18:22
@thehabes thehabes requested a review from cubap as a code owner February 18, 2026 18:22
Copy link
Copy Markdown
Member

@cubap cubap left a comment

Choose a reason for hiding this comment

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

This doesn't address the extra space in the message, but the name fix is good.

@cubap cubap merged commit ae3aea9 into development Feb 18, 2026
4 checks passed
@cubap cubap deleted the names-in-emails branch February 18, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants