D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

workflow email notifications

  • 1.  workflow email notifications

    Posted Aug 05, 2020 05:08 AM
    During initial setup we assigned admin account to be sender of email notifications. Recently we tried to change this to a service account but all emails sit on 'waiting' and never send. We are using MFA. It appears that Admin has some built-in permissions to send as or send on behalf that I can find no documentation about. Has anyone else tried to setup a service account for mailing from F&O. Any help or pointers appreciated

    ------------------------------
    Jeffrey Harrington
    Synamedia
    ------------------------------
    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: workflow email notifications

    Posted Aug 05, 2020 04:46 PM
    Ohhhhh man I am new to D365 (4 months) and this is EXACTLY what im working on right now. So we had all of the workflows configured before go live but we never turned on the email notifications per sae. So Ive been tasked with doing so. What I had to do (which is a lot) is listed below:

    Ensure the User's User Options have Send Email Notifications in Workflows
    Ensure you have the correct email templates selected in the workflows
    Ensure Each Workflow is configured for every Legal Entity
    Ensure SMTP Email parameters are configured in Sys Admin
    Ensure SMTP Email type is selected in User Options

    Now, heres the BIG one. For each user that is going to send emails from D365 using workflow assignments, we had to go into Office 365 Admin Ceneter and setup a "Send on Behalf of" d365email@account.com. This allows the system to send from the ERP for each user as the AdminEmail account.

    Hope this helps. Good Luck!

    ------------------------------
    Stuart Broach
    Medicago
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: workflow email notifications

    TOP CONTRIBUTOR
    Posted Aug 06, 2020 09:34 AM
    Jeff,

    The emails should be in a failed state if you've failed to allow the SMTP account to have send-as rights on the end users mailbox within the O365 admin portal. If they are stuck in the waiting status, you'll need to check the batch job 'Email distributor batch' and ensure it is in a 'Waiting' status. Ensure the recurrence is set to every minute or so.

    If that resolves the waiting issue, but now they fail due to the SMTP account not having send-as rights, head over to the O365 admin portal.

    However, this typically poses a huge security risk.. What if the SMTP service account is compromised? They could theoretically send as any email in your org..

    If this is a concern for your organization, check out the free Docentric version here: https://ax.docentric.com/

    Their email batch distributor and code changes allow you to side step this security concern.

    ------------------------------
    Ian Gorman, PMP, MCSE
    Solution Architect
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 4.  RE: workflow email notifications

    SILVER CONTRIBUTOR
    Posted Aug 07, 2020 09:17 AM
    Regarding the SMTP issue, if you have O365, you should be able to set the batch email provider to Exchange rather than SMTP and not have to use any of the SMTP settings:





    ------------------------------
    Ben Morgan
    M3 Engineering & Technology Corp
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 5.  RE: workflow email notifications

    Posted Aug 10, 2020 05:37 AM
    Hi
    We are using the Batch Email provider: Exchange set up, but when we run the job the email lines get in status Failed and the below error message appear. Any idea what authorization set up is missing?

    Microsoft.Dynamics.Ax.Xpp.ErrorException: The remote server returned an error: (401) Unauthorized.

       at Dynamics.AX.Application.SysMailerFactory.`logDetailedSendFailure(String _mailerName, Exception _exception, Guid _correlationId) in xppSource://Source/ApplicationFoundation\AxClass_SysMailerFactory.xpp:line 231

       at Dynamics.AX.Application.SysMailerFactory.logDetailedSendFailure(String _mailerName, Exception _exception, Guid _correlationId)

       at Dynamics.AX.Application.SysMailerExchange.`sendMessage(MailMessage _message, Boolean _interactive, Guid _correlationId) in xppSource://Source/ApplicationFoundation\AxClass_SysMailerExchange.xpp:line 137

       at Dynamics.AX.Application.SysMailerExchange.sendMessage(MailMessage _message, Boolean _interactive, Guid _correlationId)

       at Dynamics.AX.Application.SysMailerExchange.`sendNonInteractive(MailMessage _message) in xppSource://Source/ApplicationFoundation\AxClass_SysMailerExchange.xpp:line 82

       at Dynamics.AX.Application.SysMailerExchange.sendNonInteractive(MailMessage _message)

       at Dynamics.AX.Application.SysEmailDistributor.`processEmails(Guid _emailProcessorId) in xppSource://Source/ApplicationFoundation\AxClass_SysEmailDistributor.xpp:line 186

    Thanks.

    ------------------------------
    Gergina Todorova
    Danish Refugee Council
    Copenhagen
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 6.  RE: workflow email notifications

    SILVER CONTRIBUTOR
    Posted Aug 10, 2020 08:49 AM
    First, just a general clarification - you don't have to set up _every_ user in your system with 'send as' rights to the email service account you use.  You just have to set this up for the account that runs the batch job, if it is different than the email you want to send as.  For example:

    You have a service account used to send your workflow emails - dynamics365@yourdomain.com:


    Your email distributor batch is run by batchuser, with account batchuser@yourdomain.com:




    You just need to set up batchuser to be able to send as dynamics365.  The account settings at the user level shouldn't impact the system-generated emails other than to determine the recipient address if that user is the recipient.  The sender address is what you've determined in your settings for the email template, and you shouldn't have errors as long as the account running the batch job can send as that email address.

    Please let me know if I may provide additional information.

    Best,
    Ben

    ------------------------------
    Ben Morgan
    M3 Engineering & Technology Corp
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 7.  RE: workflow email notifications

    TOP CONTRIBUTOR
    Posted Aug 10, 2020 08:58 AM
    Good to know, Ben! We had reached out to Microsoft about this back in December and they led us to believe it would have to be on all users! 




    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 8.  RE: workflow email notifications

    Posted Aug 10, 2020 09:32 AM
    This thread has been very informative, thank you for your inputs. To echo your response Ian, we were told by our partner that it would need to be setup for each user as well. I still have everything in test and QA and haven't moved it to Prod yet as I am awaiting approvals; but should I consider re-configuring it to work the way you have described it Ben, or is there any drawback to having it setup the way I currently have it which is as follows:
    temp
    temp2
    I will have all users setup in O365 Admin to Send on Behalf d365@domain.com

    Thanks in Advance


    ------------------------------
    Stuart Broach
    Medicago
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 9.  RE: workflow email notifications

    SILVER CONTRIBUTOR
    Posted Aug 10, 2020 09:46 AM
    Hi Stuart,

    I don't think there is a drawback to this setup.  The configuration section is the same as we have.  The only "issue", if you can call it that, is that the SMTP settings will be ignored if you have your email provider set to Exchange (we don't have anything for these settings, and it works just fine).  So those settings really aren't doing anything in this scenario, but it doesn't hurt anything for them to be there.

    Best,
    Ben

    ------------------------------
    Ben Morgan
    M3 Engineering & Technology Corp
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


  • 10.  RE: workflow email notifications

    Posted Aug 10, 2020 03:53 AM
    Thank you for responding. I do have access to O365 and do know about setting individual users accounts with 'Send as' and 'Send on behalf'. However, D365Admin doesn't require this setting and as I have about 3.5k users I don't think it's a practical solution to set this up. I was hoping to find out if there is another way to allow this to be set up. If anyone knows of a way then I would appreciate the pointer. Thanks

    ------------------------------
    Jeffrey Harrington
    Synamedia
    ------------------------------

    The first step toward cloud success. - Migrate from AX to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role