web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Dynamic Email Signature

(0) ShareShare
ReportReport
Posted on by 160

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,

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    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:

    Animation.gif

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans