add full name if exists in email-invite-subject or when tagging someone with '@' while commenting a card

This commit is contained in:
Emile NDAGIJIMANA 2021-10-18 15:26:01 +02:00
parent b12312f998
commit d9329a9e15
6 changed files with 23 additions and 7 deletions

View file

@ -217,9 +217,13 @@ if (Meteor.isServer) {
const icode = InvitationCodes.findOne(_id);
const author = Users.findOne(Meteor.userId());
try {
const fullName = Users.findOne(icode.authorId)
&& Users.findOne(icode.authorId).profile
&& Users.findOne(icode.authorId).profile !== undefined ? Users.findOne(icode.authorId).profile.fullname : "";
const params = {
email: icode.email,
inviter: Users.findOne(icode.authorId).username,
inviter: fullName != "" ? fullName + " (" + Users.findOne(icode.authorId).username + " )" : Users.findOne(icode.authorId).username,
user: icode.email.split('@')[0],
icode: icode.code,
url: FlowRouter.url('sign-up'),