Skip to main content

Notifications

Customer Service forum
Answered

Case email send as queue instead of individual - dynamically based on queue?

Posted on by 65

Hi, the default behaviour when sending an email is for it to show as from the individual. I would like it to instead show as from the queue which the case is in. Is anyone aware of a way to do this dynamically based on queue?

I am aware there are some workarounds to create workflows or use JavaScript, but they do not dynamically set the queue. For context we have multiple queues so rather than sending "from" the fixed address of a particular queue I'd want the email to send as from the relevant queue the case is actually in?

  • Suggested answer
    Ian_P Profile Picture
    Ian_P 29 on at
    RE: Case email send as queue instead of individual - dynamically based on queue?

    Great solution thanks.

    If we wanted to use the queue from regarding object if there was a queue, and if not use the Created By Users Default Queue, would that be easy to add to this script?

  • Zap Objects Profile Picture
    Zap Objects 913 on at
    RE: Case email send as queue instead of individual - dynamically based on queue?

    Hi Adam,

    I think you will need to do additional customizations...probably save the queue email in a field in case...
    and then load it when Email form is opened...

    We have done something like this in Zap Helpdesk App too:
    Blog: How New Enhancements (March 2020) to “Quick Email Reply” Section makes it faster for Support Agents to reply back to Customer when using Zap Helpdesk -Email to Case App for Dynamics 365 for Customer Service (link)

    Blog: How to design a Customer Support process when using Dynamics 365 for Customer Service? (link)

  • empath-e CRM Profile Picture
    empath-e CRM 1,134 on at
    RE: Case email send as queue instead of individual - dynamically based on queue?

    Hi leo zhang

    We have just come across your response as we have hit the same issue too but it does not seem to work if you manually convert emails from a Queue to a Case as the Case is no longer referenceable in the Queue once it is converted. How does your fix reference back to the Queue the Case was generated from?

  • dvn92 Profile Picture
    dvn92 65 on at
    RE: Case email send as queue instead of individual - dynamically based on queue?

    Thank you this works perfectly!

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Case email send as queue instead of individual - dynamically based on queue?

    Hi Partner,

    You still could use JS to do this.

    Please refer to the following code and add it on email form onLoad event.

    function setQueue(executionContext) {
        var queueID;
        var queueName;
        var formContext = executionContext.getFormContext();
        var regarding = formContext.getAttribute("regardingobjectid").getValue();
        if (regarding != null && regarding != undefined) {
            var regardingType = regarding[0].entityType;
            var regardingID = regarding[0].id;
            regardingID = regardingID.substring(1, regardingID.length - 1);
            if (regardingType == "incident") {
                Xrm.WebApi.retrieveMultipleRecords("queueitem", "?$select=_queueid_value&$filter=_objectid_value eq "   regardingID).then(
                    function success(result) {
                        for (var i = 0; i < result.entities.length; i  ) {
                            queueID = result.entities[i]._queueid_value;
                        }
                        Xrm.WebApi.retrieveRecord("queue", queueID, "?$select=name").then(
                            function success(result) {
                                queueName = result.name;
                                var value = new Array();
                                value[0] = new Object();
                                value[0].id = queueID;
                                value[0].name = queueName;
                                value[0].entityType = "queue";
                                formContext.getAttribute("from").setValue(value);
                            },
                            function (error) {
                                console.log(error.message);
    
                            }
                        );
    
                    },
                    function (error) {
                        console.log(error.message);
                        // handle error conditions
                    }
                );
                
            }
        }
    }

    And then when you create email from case timeline, the "From" will be set to the queue of the case automatically. It is dynamically, not special.

    pastedimage1600226154189v2.png

    Best Regards,

    Leo

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

News and Announcements

Give Back to the Community this Month

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans