Dynamic HTML template to an email using sendgrid java

108 views Asked by At

I am using sendgrid java to send an e-mail where email is of HTML. And the html contains some dynamic content which comes as a request from the frontend.I have a text field on frontend where it contains some spaces and newlines(\n). If I send the text exactly to the java service where it maps the text to an html Template. In this whole process of feature, what to do if i want to get the line breaks on email html

I have tried using StringEscapeUtils.unescapeHtml4(text) in java to render it with line breaks but its not working.

1

There are 1 answers

4
Josh Austin On

Have you tried using the <br /> HTML tag for newlines?