Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email template variable naming prevent DRY #1218

Open
sldblog opened this issue Oct 6, 2022 · 1 comment
Open

Email template variable naming prevent DRY #1218

sldblog opened this issue Oct 6, 2022 · 1 comment

Comments

@sldblog
Copy link
Contributor

sldblog commented Oct 6, 2022

Short problem statement; why is this a problem?

Variables in our email templates are not consistent.
This leads to unnecessary code duplication.

This leads to dealing with errors like EventException: NullPointerException: null; while processing ReferralEvent more difficult (there's no assignee).

Link to different approaches

With camelCase:

"spFirstName" to userDetails.firstName,
"referenceNumber" to event.referral.referenceNumber!!,
"referralUrl" to location.toString(),

With snake_case:

"sp_first_name" to userDetails.firstName,
"referral_number" to event.referral.referenceNumber!!,
"referral" to location.toString()

Do you have a proposed solution? Why?

Standardise on one casing. Use it everywhere.

This requires duplicating templates until the switchover happens.

@sldblog
Copy link
Contributor Author

sldblog commented Oct 7, 2022

#1219 partially DRYs the code up, but there are still templates with different casing and names for the same values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant