Today I had to send a specific email from Business Central from a specific backoffice account. Roberto Stefanetti has written an excellent blog post about Business Central email and email scenarios. Which is fine for the built in processes but I had an entirely new scenario.
The solution was simple, all I had to do was extend the “Email Scenario” enum and use that scenario for generating my email. Below is the whole setup and code. Enjoy!
My driving force is the will to learn. Every day brings its unique challenges, my goal is to rise to each challenge and learn from it.
My professional expertise is the streamlining and optimization of business processes. My experience ranges from software development (I know AL, C/AL, C#, .NET, JavaScript, ReactJS etc) and implementation to business processes optimization, project management, training, and coaching.
At the heart of what I do lies my vision, “sustainable change comes from conscious choice, made out of free will”.
View more posts
4 thoughts on “Create a custom Email Scenario For Business Central”
The email scenario is selected when you create an email from code. So when you create an email from an order the Sales Order scenario is used. Check the Assign Scenario page for this.
The scenario is used to specify you outbound email options. With a scenario you can specify for instance which account sends the email So you can send sales documents from sales@yourdomain and purchase documents from buyer@yourdomain.
When you create your own email scenarios you must call them from that part of your code that generates the email.
where does the function EmailMyScenarion fit in the whole process? How does the system know to run this function?
LikeLike
The email scenario is selected when you create an email from code. So when you create an email from an order the Sales Order scenario is used. Check the Assign Scenario page for this.
The scenario is used to specify you outbound email options. With a scenario you can specify for instance which account sends the email So you can send sales documents from sales@yourdomain and purchase documents from buyer@yourdomain.
When you create your own email scenarios you must call them from that part of your code that generates the email.
LikeLike
I think I figures it out. The send function includes the new Enum
LikeLiked by 1 person