Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

How to automatically put shared mailbox address in "From" field when sending emails

(1) ShareShare
ReportReport
Posted on by 6
Hi, 
 
I've only very recently created a model driven app using Dynamics customer service functionality. 
The main purpose of this app as a small-scale case management tool.
We have already gotten our shared mailbox set up. However, when I click to create a new email, my email always pop up in the "From" field rather than our preferred shared maibox address. 
 
Is there any way to alter this?
I am sure I am not the first to think of this, however I'm not very good at wording my Dynamics questions correctly yet, so any tips on blogs/other resources on how to make Model driven apps better for case management is much appreciated!

Best, 
Ida
  • idanorin Profile Picture
    idanorin 6 on at
    How to automatically put shared mailbox address in "From" field when sending emails
    Thank you @Jimmy Passeti | MVP,  @Mahendar Pal and @Amit Katariya007!

    With the information the three of you provided (along with this youtube video Web resources and Insert Java script code in the Model driven app - Power Apps) I finally figured out how to do it. 
     
    Extra big thanks to you, Jimmy, for providing the code as well. I am so green at JavaScript, so that was immensely helpful.
     
     
    @BenjaminColeman yes, with Jimmy's code snippet, and the additional information, it was way easier than I had feared.
    Best of luck to you!
     

    Edit: I am attempting to mark your reply Jimmy as the solution, however whenever I reload the spot is unchecked. Will try again later. Any tips are welcomed :')
  • BenjaminColeman Profile Picture
    BenjaminColeman 10 on at
    How to automatically put shared mailbox address in "From" field when sending emails
    have you managed to resolve this issue?
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 10,089 Super User 2025 Season 1 on at
    How to automatically put shared mailbox address in "From" field when sending emails
    Create a plugin which will run on Pre operation of email entity. Then populate the from field as per your requirement.
     
  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    How to automatically put shared mailbox address in "From" field when sending emails
    Hi,
     
    What you see is the default system behavior which auto populate from lookup with the current user, if you want to change this you can create web resource and use script to auto populate this field so for example if you can setup a queue where you can use your shared email address and then using script you can populate queue under from field.
     
     
    You need to call your java script method on load.
     
     
  • Verified answer
    Jimmy Passeti | MVP Profile Picture
    Jimmy Passeti | MVP 253 Super User 2025 Season 1 on at
    How to automatically put shared mailbox address in "From" field when sending emails
    Hello,
     
    This can be done using JavaScript.
     
    Below is an example of that, Imagining a scenery in which the email will be sent by a queue.
    function _setFromUser() {
        var QueueID = "00000000-0000-0000-0000-000000000000";
        var recordName = "Queue Name";
        var entityName = "queue";
        Xrm.Page.getControl("from").getAttribute().setValue([{ id: QueueID, name: recordName, entityType: entityName }]);
    }
    Regards,
    Jimmy Passeti | Microsoft MVP
    ✅ Please mark as Verified if this answered your question!

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,234 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans