1 Mar’19

D365 Business CentralSending Email from Admin on behalf of sender in Business Central using MS Flows

Introduction:

In Business Central, to send an Email the sender Email is always the user in SMTP Setup. But, what happens when you are sending email from <admin@yourorganization.com> but should be going department wise ie. <sales@yourorganization.com> and <marketing@yourorganization.com>. Thus in this blog I’ll be showing how to send email from the department email using the admin email.

Pre-requisite:

1. VS Code.
2. Office 365.
3. Microsoft Dynamics Business Central.
4. MS Flows.

Demonstration:

1. Setting Up MS Flows:

  • Creating the HTTP request:
  • Using Sample Payload as :
    [{
    "sender":"Test Sender",
    "recepient":"Test recepient",
    "subject":"Test Subject",
    "body":"Test body"
    }]
    
  • Add the  Send an Email action:

  • Save the MS Flow and copy the trigger URL in  Postman and passing JSON, check if you the email.
  • Check mail box for delivery of Email

2. Enable email delegation in Office 365.

In portal.office.com, navigate to Admin > Admin Center > Exchange > Mail boxes > <–Admin Email–> > Delegate

Add you department email here. In this cas Cloudfronts@xyz.com is admin email and olisterr@xyz.com is department email.

3. Call the MS Flows from Business Central.

Code:

4. Output

Conclusion:

Thus in this way we can use MS Flows Webhooks to actually trigger an email passing the data through JSON as an POST http request.

Written by

Olister Rumao

Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Expenses in PSA for Fixed Bid and T&M contracts

    23 August’ 2019

    Problem Definition: One of my clients decided to use Expense module in PSA and to his surprise he could see the amount v...

    Read more
  • Setup Dockers

    23 August’ 2019

    Docker is an independent container platform that enables organizations to seamlessly build, share and run any applicatio...

    Read more
  • Qualify Lead in D365 CE: Select which entity records should be created

    20 August’ 2019

    Wave 2019 Updates brought some really sought-after features. Another one which I would like to bring up is the Lead Qual...

    Read more
  • Early Opt-in for October 2019 Wave 2 Updates

    20 August’ 2019

    August 2, 2019 was when the Wave 2 Updates were to be out. And here we are! By now, you should have gotten the option to...

    Read more
  • Setting Unified Interface App Icons

    20 August’ 2019

    Default App Icons for typical D365 environment look like these.But here’s what you can do to change these to put...

    Read more
  • We respect your privacy.
  • This field is for validation purposes and should be left unchanged.