I am trying to select the appropriate email template using javascript on a custom button. Here is a stripped down version of my code:
var template;
var type = "{!My_Custom_Object__c.My_Field__c}";
if(type == "Quick") {
template = "00XV0000000DlRB";
}
location.replace('/email/author/emailauthor.jsp?p3_lkid={!My_Custom_Object__c.Id}&[email protected]&p5=&template_id=template')
If I replace the end of the last line with template_id=00XV0000000DlRB
, it works; but if I use the variable template, it says template_id contains a character that is not allowed
. Any ideas? Thanks.