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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

From address from name default

(0) ShareShare
ReportReport
Posted on by

Hello,

When creating a marketing email the from name and from address is the name of the user who created the email. Is it possible to change the default individually per Business Unit? I see a  risk that at some point we will forget to change the from name and address .... and send out an email in our name to all customers. 

Best, 

Nadine

I have the same question (0)
  • Suggested answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Nadine,

    You could run a custom JavaScript function at OnLoad event of marketing email form to populate "from name" with business unit name of current user, and "from address" with a concatenated email address with bu name.

    function autoPopulate(executionContext) {
    
      var formContext = executionContext.getFormContext();  
    
      var globalContext = Xrm.Utility.getGlobalContext();
    
      var currentUserID = globalContext.userSettings.userId.replace(/\{|\}/gi, "").toLowerCase();
    
      Xrm.WebApi.retrieveMultipleRecords("systemuser", "?$select=fullname&$expand=businessunitid($select=name)&$filter=systemuserid eq '"   currentUserID   "' ").then(
        function success(result) {
          for (var i = 0; i < result.entities.length; i  ) {
            var businessUnitName = result.entities[i].businessunitid.name;
            formContext.getAttribute("msdyncrm_fromname").setValue(businessUnitName);
            var originalFromAddress = formContext.getAttribute("msdyncrm_fromemail").getValue();
            var domain = originalFromAddress.substring(originalFromAddress.indexOf("@")   1, originalFromAddress.length);
            formContext.getAttribute("msdyncrm_fromemail").setValue(businessUnitName   "@"   domain);
          }
        },
        function (error) {
          console.log(error.message);
        }
      );
    
    }
    
    

    Steps to add the custom function:

    1. Top right gear icon > advanced settings > customizations > customize the system

    2. Entities > Marketing email > Forms > Designer

    3. Form properties: add custom JavaScript library > enable the custom function at OnLoad event of form.

    pastedimage1600937952444v1.png

    Both of two options are required to be checked:

    pastedimage1600938071505v2.png

    4. Save and publish the form.

    Result:(I changed the real business unit name to sample name.)

    The From name will be set to business unit name of current user.

    The From address will be set to a concatenated email address with bu name and the original domain.

    pastedimage1600938168033v3.png

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at

    Hi Nadine,

    Could the solution work for you?

    Regards,

    Clofly

  • Community Member Profile Picture
    on at

    Hi, Thanks a lot! But unfortunately I am no Java script expert :/ Isnt there a real clean solution from Microsoft somewhere and maybe I have no idea that it exists :)? But I will ask some developers, maybe they can have a look and implement it for us :) Thanks a lot anyway!

    Best, Nadine

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 131 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 91

#3
Chris1968 Profile Picture

Chris1968 20

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans