I am struggling with the syntax template.print()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 02:10 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 03:02 AM
Did u try adding <mail_script> tag?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 03:16 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 04:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 05:20 PM
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>