Spharah
Spharah

Reputation: 655

Random blank spaces in email content sent using SendGrid

I have created the WebAPI that sends email when user signup. The email

Problem
There are random spaces that are added in the email content

e.g: api/account/authUser -- api/account/a uthUser

I am using nodemailer and SendGrid as email service

Upvotes: 1

Views: 1462

Answers (1)

Martyn Davies
Martyn Davies

Reputation: 1511

I recommend that in order to give yourself greater control you use the SendGrid Template Engine to manage the template code, and simply pass in substitutions instead. It would be cleaner and easier to manage and you can remove all those concat blocks from the code you have currently. I expect that you'll find the spaces go away.

Template Engine documentation can be found here: https://sendgrid.com/solutions/email-template-engine

You can see an implementation in action here: https://sendgrid.com/blog/migrating-app-sendgrids-template-engine/

Upvotes: 2

Related Questions