Automatically Send Emails From A Queue

*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***

When creating and sending an email from D365, the default functionality will populate the FROM sender as the user creating the email. Depending on a users role within the organisation, if they work on a team managing cases or other shared work, emails may need to all come from one email address. The users email address needs to be accurate in the system so we can’t change that, but we can use a queue combined with a workflow to send emails from queue rather than the user.

First, go to Settings, Business Management then click on Queues.

Create your queue (if you don’t have one already) by using your group email address in the incoming email. Save the queue.

At the top of the queue, click on Open Mailbox. From here, a user with Global Administrator (Office 365) access should click on Approve Email. One approved, then Test & Enable Mailbox to allow emails to be sent out from this email address via D365.

Once the queue is set up and the mailbox is approved and enabled, create a new workflow. Make sure it’s a real-time workflow so it will run before the email gets sent out. Make sure it starts After the record is created.

*UPDATE – 11/10/2018* – originally I had stated in the post to also tick Record status changes and change that to Before. Although the email ended up getting sent and received, the status of the email record in CRM remained as ‘Pending Send’. Removing this as part of the scope sends out the email and allows the status of the email to change to ‘Sent’. Thanks to Una Clancy and several other people for the comment about this, which prompted me to investigate further! *END UPDATE*

Your workflow should look something like this. Created By isn’t needed if this should be changed for all users. However, if it should only happen for SOME users, or under specific circumstances (if regarding a case for example) make sure you build this in to the conditions.

When updating the email, set the properties to use the queue you set up as the From object.

When a user creates a new email, their name will still show as the From person.

Once Send is clicked the workflow will run, and the From will be switched from the user creating the email to the queue you selected instead. This way the users will not have to remember to change it over each time they create a new email.

20 thoughts on “Automatically Send Emails From A Queue

  1. Hi Megan.
    Thank you for this interesting post.
    Can it be used when sending bulk email against marketing list?
    The queue can be used only to send but not to receive emails?
    Regards, Emma

    1. Hi Emma, queues are used to send OR receive emails. So you could use a queue to receive incoming emails to support@meganvwalker.com and then use a record creation rule to create cases for each email. Or, you might have an email like notifications@meganvwalker.com or DoNotReply@meganvwalker.com so you don’t want responses coming back in to CRM, and only use it to send from. When you set up the Queue and activate the mailbox you can determine if you use it for Incoming Emails, Outgoing Emails or both. And yes, you could use your Queue to send your bulk emails for sure! You would just need to have a workflow similar to what I have described in this post to make it change to send from the Queue.

      1. Hello Megan,

        thanks for your tip regarding setting the From e-mail to a Queue e-mail.
        I have tested it and it work – that is, the e-mail I get is sent from the Queue.
        However, when I open the Mail activity I can see, that D365 does not consider the mail sent and the real-time workflow has thrown an exception saying: “Cannot update parties unless email is in draft status”

        I don’t know if you have checked that out if that problem is also on your instance?
        From what I can read, it seems to be a timing/race-condition between the Mail activity and the real-time workflow.

        1. Hi Andy, thanks for the comment and checking out my blog. I haven’t seen that issue. The only thing I am wondering, do you have the condition of running the workflow after the email is created and before the status changes?

  2. Hi Megan, thanks for sharing this post.

    I had the same scenario, and I followed your instructions. Everything is successful, but there is one problem. Every 30 min I am getting the same email that I sent, and that process will not stop unless I deactivate the workflow and queue. Any ideas what that could be?
    Thanks

    1. Hi Una,

      Thanks so much for taking the time to review and ask a question. I took a moment to troubleshoot and came up with the answer. Take a look through the post again and you will see the update. Thanks again and apologies for any frustrations caused!

  3. Thanks Megan,

    I found the issue there was another workflow running at same time on email entity and mine workflow was running on every status change. so i put in a condition to say only run when status = draft and its now working and changing the status on emails to sent. thanks for your time.

  4. Hello Megan,

    When setting up a queue, does the email address have to be the same domain as parent BU? I’m trying to create a queue using a gmail address and receive failures when trying to test and enable mailbox.

      1. Thanks Megan! That’s exactly what I needed for setting up Gmail. In regards to setting up a queue for a another domain (different from parent), but owned by me. Would I simply need to add/validate those domains into the D365 portal, create the queue, and then test mailbox? I shouldn’t have to create a new email server profile for each domain would I?

        1. You are welcome, that article looked like it would help. In terms of any additional domains you want to send emails from, then yes you would need a different email server record set up for each one. If you think about it, if you didn’t need that to be set up, I could send out an email from your domain without you knowing our approving it right? So there needs to be a level of control and security, hence the need for the email server profile.

  5. Megan,

    Am I right in thinking that if the workflow is set up as you show then any email sent outward from the CRM system would have its From address altered to the queues email address?

    Can you think of anyway of making it more selective so that emails can be sent from a number of queues depending on what the query / question is about?

    1. Hi Dave, yes, you could certainly do that. If you look at screenshot 5 in the article, that shows part of the condition of the workflow. You could add alternative conditions and say ‘if the related cases ‘Case Type’ field equals “X”, send the email from “X Queue”, or if it equals “Y” send it from the “Y Queue”. So you could have lots of different clauses in that workflow. Does that help?

      1. Megan,
        You have pointed me in the right direction in being able to selectively pick the right queue. However, now when creating the workflow I cannot seem to specify anything other than a User or Team in the From field i.e. it will not let me specify a Queue name in the From Field.
        Any ideas why that might be?

        1. Hi Dave. I have seen that happen in a workflow before, where for some reason you are no longer able to access the From Field. It’s a pain, but what happens if you start again with a new workflow. Do you still have the same issue?

          1. Megan,
            I reproduced the WorkFlow twice (after deleting the previous attempts) and unfortunately still the same problem. Rather annoyingly, it will allow me to enter the Queue name in the To: field which seems a bit bizarre! I will keep on trying to resolve the problem.

  6. Hi Megan.
    Thank you for this interesting post.
    How to set the email filter condition to update the From email address only if we are replying to case email?

    I have tried couple filters but it didn’t worked for me.

    Any suggestions please.

    Thanks,

    1. Hmmm good question. Maybe in the condition check the Regarding Case, then make sure the Case field contains data. Try that and see if that works.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *