Hi,
I've created a email signature that salespeople needs to use when sending emails from the CRM. It needs to be dynamic, so they can easily insert it. But I bumped in some problems.
I wanted to create it under email signature. But it seems like you can't create dynamic fields in email signature.
So I tried to create an email template. But subject is required. Which means that when I want to insert the template to an email. I get a question asking if I want to change the subject to the template subject. I think this can ba a problem if someone doesn't read the question and presses ok, and then sends out an email with an incorrect subject.
I tried creating a process, that I wanted to say "When email is created add email template, delete subject line." But seems like the entity for the quick create email in CRM exsist. Do you have any tips on how I can do this?
Thanks,
Hi Filippa F,
I haven't found any OOB way to do this. So I created an onchange event on Subject field of the Email Main form.
Please see the following script:
function onchange(executionContext){ var formContext = executionContext.getFormContext(); var subject = formContext.getAttribute("subject").getValue(); var email_template_used_subject = ["We haven't heard from you...","xxxxxxxxxxxxx"]; if(subject == null || subject == "" || email_template_used_subject.indexOf(subject) === -1){ return; } var emailId = formContext.data.entity.getId(); if(emailId != null && emailId != ""){ formContext.data.save().then( function success(){ Xrm.WebApi.retrieveRecord("email", emailId).then( function success(result) { if(result['_templateid_value'] != null && result['_templateid_value'] != ""){ formContext.getAttribute("subject").setValue(""); } }, function (error) { console.log(error.message); } ); }, function (error) { console.log(error.message); } ); } }
Result:
However, it needs you add all your email template's subject into an array. You could have a try and hope it can help you.