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

MANOJM820830658
Tera Contributor

its not short description, its" DESCRIPTION OF THE FORM"

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);

Hi Rajeev,

 

im getting undefined in email body

MANOJM820830658_0-1738521554883.png

please take a look at the code too--

MANOJM820830658_1-1738521593427.png

 

code correction but still undefined is the result.

MANOJM820830658_3-1738521724558.png