The CreatorCon Call for Content is officially open! Get started here.

Email formatting issue in email notifications

MANOJM820830658
Tera Contributor

Hi,

 

In email scripts i am directly inheriting the short description of the form as email body, but the format in which short description was written is not the same in the preview of notifications and email received. please help me with this.

i have attached the code and both short description and its preview, please take a look at it.

code---

MANOJM820830658_0-1738520469679.png

preview of the body notifications --

MANOJM820830658_1-1738520501679.png

short description from the form----

 

MANOJM820830658_2-1738520589430.png

 

 

1 ACCEPTED SOLUTION

rajeev17
Mega Guru

Hi Manoj ,

 

I have used below one which worked for me try to replace and see .

var shortDescription = current.short_description.replace(/\n/g, '<br>'); // Replace line breaks with <br>
var emailBody = "Hello,<br><br>";
emailBody += "Short Description: <strong>" + shortDescription + "</strong><br>";
email.setBody(emailBody);

View solution in original post

7 REPLIES 7

rajeev17
Mega Guru

And also whether these question are dynamic or static?

these questions are written in the description of the form, which is inherited to the email body.

MANOJM820830658
Tera Contributor

Hi, all used the below code and it worked

 

MANOJM820830658_0-1738523316640.png