You will need
- Your tyntec API key from the Business Center
- Your WhatsApp Business Account Number that has been assigned to you by tyntec
- Your WhatsApp Message Template
- A mobile phone with WhatsApp for testing
- A testing Microsoft Dynamics account with the Marketing app installed
- A Microsoft Power Automate Free license in your Dynamics Environment
- A Contact in your Microsoft Dynamics with the mobile number set to your WhatsApp phone number
- A testing Event record in your Microsoft Dynamics
Tip: You can use the default message template named default_welcome.
Step One: Create your Flow
To quickly start with Power Automate and the tyntec WhatsApp Business connector, you will build a sample Flow. Let’s look at what it does.
The sample Flow works in your Microsoft Dynamics background and automatically listens to the creation of a new Event registration (the Trigger). Once triggered, it calls the Action Send WhatsApp Template message to the assigned Contact in the Trigger.
1. Open your Power Automate.
2. In the left dropdown menu, click the Create button.
3. From all possible Flow types, select Automated—from blank.
Automated flows run when an event triggers, Instant flows on a manual trigger, and Scheduled on a given time condition.
4. In the design window pop-up, use the search function to find the event When a record is created, updated or deleted from Common Data Service. Then click the Create button.
You are now in the UI Flow designer that can add Actions to your Flow and chain them into algorithms. The designer automatically creates When a record is created, updated or deleted trigger step.
5. Within the When a record is created, updated or deleted step, set the Trigger condition to Create, The entity name to Event Registrations, and Scope to Organization.
Your Trigger is now listening for any new event registrations.
6. To create a new action, click the + New step. In the step selection, search for the Get Record action.
In the Get Record action step, set the Entity Name to Contacts and Item ID to Contact (Value) dynamic content.
7. Click the + New step. In the step selection, search for tyntec WhatsApp Business, and select the Send WhatsApp Template message action.
8. Tyntec Connector will automatically try to create a connection. Name your Connection and set your apikey to your tyntec API key.
Afterwards, the Send WhatsApp Template message action updates itself to show you different fields:
9. Set the to field to Mobile Phone dynamic content, the from field to your WhatsApp Business Account, the templateId field to your templateID, the language-policy field to your template's language policy, and the language-code field to your template's language code.
10. Set the components parameters type - 1 to text. The components parameters text - 1 specifies the content of your WhatsApp message parameter. Set the value to your desired text.
You can use dynamic content to autofill data. For example, in the default template, you have one parameter, the user's name. To automatically use it, set the components parameters text - 1 field to First Name dynamic content.
Tip: If your message template has more parameters, you can use dynamic content to fill them automatically.
Step Two: Test your Flow
Let's try triggering your Flow. In this testing phase, you will create the Event Registration manually.
1. Go to your Dynamics 365 and select your Marketing instance.
2. In Marketing, scroll down to Event Management. Then click on Event Registrations and + New.
3. Set the Primary role to Attendee, add contact into the Contact field, and add your event into the Event field. When you are happy with the details, click Save.
4. As soon as you click Save, the Flow starts. Look at your testing phone, you will see your WhatsApp message.
Congratulations on completing your Flow!
More?
The main power of the tyntec WhatsApp Business connector is that you can use it alongside any connector (Dropbox, for example) that is in Power Automate. Using the Common Data Service you can access any entity within your Dynamics environment.
If you would like to scale the capabilities of this flow, it could be a good idea to add analytics to it. Each time you use the Send WhatsApp Template message action the Flow receives a messageId dynamic content as response.
Using the tyntec WhatsApp Business action Status Check with the messageId returns you the status of your message (for reference, look at the API docs). You can save the response from the Status Check within a custom entity or attach it as a note to the Event Registration using the Create a record action or the Update a record action.