I am struggling with the syntax template.print()

pal1
Kilo Explorer

Hi all,

I am struggling with the syntax template.print(). I want to display buttons in an email notification.I am using html code in email notification script and using that html code within the template.print() syntax.My HTML code is working fine but when I am using that within template.print error is coming.

find_real_file.png


 

8 REPLIES 8

Harish KM
Kilo Patron
Kilo Patron

Did u try adding <mail_script> tag?


Regards
Harish

Yes harish I have added a mail script tag in the email notification.


I am unable to write the html code in the template.print().


1)My script is getting called in email notification when I used the basic html syntax.


2)My required HTML code is working fine.I have tried it in notepad and then saved it with extension .htm


3)I am facing problem with writing my required HTML code within template.print() function.


Gurpreet07
Mega Sage

It seems like some kind of validation error on the form . 2 ways to get rid of it .



method 1. split the code into individual strings and use + operator to concatenate them. Like following code could be saved easily


template.print("<html><head></head><body><style>.btn{"+


                            "background-color:red ;     color:grey ;}"+                            


                            "</style></body></html>");



method 2. Update the script field of the same record in list view


Not sure if anyone else noticed that but in line 1 where the issue is being reported it seems to be listed as:



template.print("<html><html>


<head>


</head>



I would question why you have duplicate <html> tags here as that could also be causing the confusion as based of your code there is no </html>