NodeBB Email doesn't show From Name
-
Hi,
I am using SendGrid to send email from NodeBB. I went to Settings > Email and add both email address (eg: [email protected]) and from (eg: John Smith).
The email I receive only shows the email address ([email protected]) instead of John Smith <[email protected]>
Any idea what caused this issue?
Thanks!
-
@Mickola May be stating the obvious here but just to confirm: You did also set "From Name" when you set "Email Address"?
I do not use Sendgrid but "works on my machine" with my smtp relays. At least with 12.x. Have yet to update to 13.x. So maybe a Sendgrid side issue?
-
@gotwf
I've added both "Email Address" and "From Name". The NodeBB I am using now is v1.11.2, SendGrid plugin: 2.2.3.
I check the plugin and index.js has the following:SendGrid.send({ to: data.to, toname: data.toName, subject: data.subject, from: data.from, fromname: data.from_name || userData.username || undefined, text: data.text, html: data.html, headers: data.headers, reply_to: replyTo, }, next);
So, it seems fromname doesn't return anything, not even userData.username. Any ideas?
-
I guess I found what the issue is. Apparently SendGrid API for Node.js doesn't seem to have fromname as one of its parameters. I modified the plugin and add a new line just before call SendGrid.send function.
// Add this line data.from = data.from_name + '<' + data.from + '>'; SendGrid.send({ to: data.to, toname: data.toName, subject: data.subject, from: data.from, fromname: data.from_name || userData.username || undefined, text: data.text, html: data.html, headers: data.headers, reply_to: replyTo, }, next);
Now, it's working!