Skip to content
David Alzamendi Data Enthusiast

Azure Logic App to Send Custom Messages

With Logic Apps, you can create workflows that connect to various services and systems, allowing you to automate tasks and streamline your business operations. In this blog post, we will explore how you can use Azure Logic Apps to send custom messages (email or SMS).

Pre-requisites

Before you start, make sure you have the following pre-requisites. 

  • An Azure subscription
  • An Azure Logic App created in your subscription
  • An Azure Communication Service (to send SMS, only available in some regions)

Introduction

Let’s take a quick look at what Azure Logic Apps are and what they can do. Azure Logic Apps is a cloud-based platform that allows you to build and automate workflows that connect to various systems and services. With Logic Apps, you can create complex workflows involving multiple steps and services, making automating and managing your business processes easier.

Azure Logic Apps can be used across any platform to send custom email or even SMS in some regions.

Download the Solution

You can download the solution from my GitHub repository.

Create Azure Logic App to Send Custom Error Messages

Add the following activities to your Azure Logic App.

Create Azure Logic App to Send Custom Error Messages

1) Trigger: The trigger for the Azure Logic Apps is a HTTP request.

In the request Body JSON Schema there should be name/value pairs for:

  • Title
  • Origin
  • Description (this can be empty)
  • CommunicationMethod (SMS, email or ALL)
  • MobileNumber (this can be empty)
  • EmailAddress (this can be empty)

Actions (2 possible actions):

  1. Send SMS with Azure Communication Services: it uses MobileNumber parameter as destination and Description as the SMS message.
  2. Office 365 Email: it uses Title for the subject, Description for the body and EmailAddress as the To: email
  • If the CommunicationMethod is Email, only the email address needs to be sent.

Sample HTTP Body request:

{ "Title":"Test Title", "Origin":"System A", "Description":"This is a message", "CommunicationMethod":"Email", "MobileNumber":"", "EmailAddress":"[email protected]" }

  • If the CommunicationMethod is SMS, only the SMS needs to be sent.

Sample HTTP Body request:

{ "Title":"Test Title", "Origin":"System A", "Description":"This is a message", "CommunicationMethod":"SMS", "MobileNumber":"+61044555888", "EmailAddress":"" }

  • If the CommunicationMethod is All, the SMS and Email need to be sent.

Sample HTTP Body request:

{ "Title":"Test Title", "Origin":"System A", "Description":"This is a message", "CommunicationMethod":"All", "MobileNumber":"+61044555888", "EmailAddress":"[email protected]" }

2) Control Condition to Send Email, includes the parameter CommunicationMethod
3) Action Send Email using O365 connection, you will have to create a connection to O365 (I recommend using a service account and use shared mail inbox action)
4) Control Condition to Send SMS, includes the parameter CommunicationMethod
5) Action Send SMS using Azure Communication Services connection (SMS service only available in some regions)
 

Conclusion

In this blog post, we explored how to use Azure Logic Apps to send custom messages. By following these steps, you can automate your business processes and streamline your workflow, making it easier to manage and send messages for managing your platform.

All 10 guides
Other

Preparing for 2024: Top 2 Strategic Focus Areas for Q4 2023

Are you ready to kickstart 2024? As Q4 2023 approaches and companies enter a code freeze, it's crucial to focus on strategic priorities. Explore why maximising ROI in tech investments and leveraging Large Language Models can be game-changers for your business. Learn actionable insights for adopting these key focus areas and staying competitive.

3 min read

Other

Create an Azure Logic App Service

Are you looking to create something powerful with Azure Logic Apps? In this post, I will show you how to create the service in…

5 min read

Questions or comments?

Leave a comment below

Your email address isn't published.

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.