- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2015 07:27 PM
Hey Again all you Genius's. I need your help again.
This is kind of a "idea" rather than it being functional (i think).
So here's the deal.
I love ${mail_script:scriptname} it's awesome. Very functional, works like a charm.
We have a request item that we have an approval email for. Then there is a UI action that was create to fire an Event. We created a 2nd email notification to accept this event to fire the "Resend email"
here's the deal.
The approval email we have a ${mailscript} at the very top which contains our approval/reject links. and Information about the request.
Then we have the BODY of the email. Contains the variables of the request.
Then we have 2 ${mailscript}'s at the bottom with some "for the administrator" which tells us the ticket number, what email notification send this email, and so forth.
Here is where the question comes in. We cant use an HTML template for all the notifications because we add different ${mailscripts}
What i'm wanting to know is:
Can we Create a template, that is dynamic like the mail scripts
So in my email notification, i dont have a template "attached" and used.
BUT. i used something like ${template:templatename} Because the body of my email wont change.
Is there a way to do something like so.
${mail_script:Approval-Reminder}
${mail_script:Approval-Links}
${template:templatename}
${mail_script:Approval-Additional}
${mail_script:Approval-Administrator}
Where the ${template} will actually pull the HTML data out of the template.
This way i would only have to update it 1 time and it would update in all 3 of my notifications.
I do not want to use the text box. i want to use HTML. i dont want to have to use the <mail_script> template.print() for every single line, Hence using the HTML (WYSIWYG)
Does that make any sense at all?
it would be great for the templates if you attach it as is to the email and it's used with no modifications. or if you could "call" the template data into the actual email notification like the mailscripts.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2015 08:03 PM
So i found my answer. Dot Walk.
Create an email script, say called "template"
Script will be
template.print(email_action.template.message_html);
That will take the reference field of the "template" from the email notification and then pull the HTML field from the template.
Then in the email notification you can do a ${mail_script:template} and that is all that is needed.
So now my email Notification html box looks like so:
It will translate into this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2016 09:30 AM
Hey Daniel,
I've taken this a step further and looked at your advice and created a header script, and header template, as well as a footer script and footer template.
Simply as reference fields to make it extremely easy to add things to the email. and makes it extremely easy to edit from list view, (with help from a Business rule)
Why, you ask did i do a header template, and header script?
Well because in the Template there is an HTML field, which is really a What you see is what you get, type.
and the script can essentially do anything a script can do.
you can use either or both together.
So i've taken the regular Message HTML and moved it down, since that is what is sending in the email, i dont want to touch that. i want the Business rule to set that.
I created another HTML field that i use to edit the emails.
So, in this example,
1. I set the header template (which is a picture in the template)
2. Added the header script
3. set the "message text" with what i want to be in the email.
4. set a footer script
5 set a footer template
6. always have the for the administrator script added.
When i save my record, it sets the below Message HTML box automatically.
Since this is a Business rule and not client script, i can run this from the list view. if i edit or remove one of the fields, the BR will reset the Message HTML box.
The Lower Box is what actually is sent in the Email. the top boxes just set the lower box. This saves time from having to go to the email scripts table and look to find what scripts you want to use. it allows quick entry or removal of scripts/templates without having to edit each notification by itself.
Ever wanted to add a script to multiple emails? This is very simple
Here is my BR i'm running
(function executeRule(current, previous /*null when async*/) {
// Get the Field values and set the HTML field that actually sends the notification.
var temphead = current.u_header_template;
var scripthead = current.u_header_script;
var text = current.u_message_html;
var scriptfoot = current.u_footer_script;
var tempfoot = current.u_footer_template;
var admin = current.u_admin_script;
// var html = current.message_html;
if (!temphead.nil()){
current.message_html = temphead.message_html;
}
if (!scripthead.nil()){
current.message_html += scripthead.u_mail_script;
}
current.message_html += "<hr />" + text + "<hr />";
if (!scriptfoot.nil()){
current.message_html += scriptfoot.u_mail_script + "<br />";
}
if (!tempfoot.nil()){
current.message_html += tempfoot.message_html + "<hr />";
}
current.message_html += admin.u_mail_script;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2016 09:08 PM
Hey Steve, I have almost exhausted all my options in trying to do this :
Approval Request - CHG0030334 |
Change Request CHG0030334 has been submitted for approval. Click here to APPROVE |
Have added <span style="color: green; font-weight: bold;"> APPROVE</span> in the template - didn't work.
Also tried to call a notification script from the email template, even this didn't work - "template.print('Click here to <span style="color:green;font-weight:bold">APPROVE</span>');
Took a look at this link as well - css - Outlook 2007 changes link styles in a HTML email to have a blue underline when sent to Hotmail...
Can you help me out here mate ?
Cheers
Suhas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2016 09:13 PM
Are you just trying to put it in the table boxes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2016 09:18 PM
Yeah, only the APPROVE/REJECT words in the link needs to be color coded, that's it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2016 09:23 PM
You setting those via script? What is your script?