fix: use full name instead of first name for emails notifications
Currently, Email Notifications use First Names for salutations.
The way we get the first name of the email receiver is – by getting whatever letters come before the ' '
(space) character.
const receiverFirstName = (
// ...
).split(' ')[0]
The problem with this approach is –
if someone uses a salutation like 'Dr.', and hence, a name like 'Dr. John Doe'
We can end up with an email like,
Dear, Dr.
I am writing to invite you to... Which is less than ideal.
What this Merge Requests changes
It changes all the receiverFirstName
s to receiverName
and removes the code that tries to identify the first name by taking all letters before the ' '
(space) character.
Here are the instances of getting first names that have been identified and changed in this Merge Request —
-
Reviewer response -
Reviewer Name
Receiver Name
Crossref Publishing
I also found that the code that handles publishing to Crossref splits name with a similar approach.
The file is: server/publishing/crossref/index.js
And the name is split:
On line 348
On line 420
This change may require more nuance as it explicitly splits surname and first name, and hence I have not covered the change in this MR, but it is worth looking at as it might cause similar issues as described in this merge request.