Categories
Dynamics 365

Sending HTML emails through Dynamics 365

Task: Send HTML email though Dynamics 365
Difficulty: Advanced
Time to implement: 1-2 hours

Check out this video

Tracking emails is a popular feature in Dynamics 365 Customer Engagement. You can track emails by connecting your mailbox with Microsoft Exchange and either use the Dynamics 365 app for Outlook or Dynamics 365 email capabilities to send out emails. Companies see great value in this feature because it allows them to have a CRM system in place where relevant interactions between a customer and an organization can be observed.

In this post, I am going to show you how to use the Dynamics 365 emails and discuss some of its benefits and limitations in terms of functionality. Dynamics 365 emails are equipped with a simple email editor for creating emails. The editor covers the basic requirements for what you would normally use when sending an email from your email client such as Gmail or Outlook.

Email editing experience in Dynamics 365

Dynamics 365 emails allow you to send emails to multiple recipients, add attachments, insert links and images. However, if you want to create your own HTML email you cannot do that through Dynamics 365 emails. This could be useful in scenarios where the company wants to send out a promotional emails, e.g. because there is a new product release or an event. Dynamics 365 does not support HTML emails.

On the other hand, if you like to send HTML emails through Dynamics 365 there is a workaround. By leveraging Power Automate and the Dataflex (CDS Current enviornment) connector, you can create a workflow that creates and sends an email with HTML content.

For example, you have a lead that you would like to send an event invite to. You can achieve this by creating a flow in Power Automate and use a field on the lead to trigger the flow. The salesperson could simply check a box on the lead form to send the invitation. Furthermore, the email would be automatically tracked in Dynamics 365. This gives the salesperson and her manager a better overview of who has received an invitation to an event.

In the remainder of this post I will show how you can create and send a HTML email through Dynamics 365 Sales with the help of Power Automate.

1. Create the flow

  1. You start by navigating to make.powerapps.com and create a solution for your Flow. For information on how to create a solution in Power Apps please refer to this article.
  2. Click on the ‘+New’ button and select Flow
Create a Flow from within a Power App solution
Create a Flow from within a Power App solution
  1. Search for and select the Dataflex ‘When a record is created, updated or deleted’ trigger (Common Data Service current).
  2. Give your Flow a name.

2. Configure the flow

Once you have created the flow you can define the entity name, the type of trigger condition as well as the filtering attribute for the newly created trigger. In this case we have created a custom field which will serve as the trigger for this flow or the filtering attribute.

  1. In trigger condition choose Update.
  2. In the entity name choose Leads.
  3. For the Scope select Organization.
  4. In the filtering attribute write the name of your custom field.
Dataflex 'When a record is created, updated or deleted' trigger (Common Data Service current)
The When a record is created, updated or deleted trigger (CDS current)

Next we need a variable to store our HTML. To do this we:

  1. Click on the ‘New Step’ button.
  2. Select Initialize variable.
  3. Give our variable a name and choose type string. Leave the value field empty.
Power Automate Initialize variable
Initialize variable

Before we set the variable you first want to check if our field value meets the condition.

  1. Click on the ‘New Step’ button.
  2. Select control.
  3. Choose control condition.
  4. For the condition choose the custom field and that it should be equal to ‘true’. The field is a two option field which can be either true (1) or false (0).
The condition should be that send invitation value is true.

When the condition is true you want the email to be sent. First you need to set the variable we created in our previous step and then you will create the email. Lastly you want to send the email message using a bound action.

  1. In the ‘If yes’ box click ‘Add an action’.
  2. Choose Set variable.
  3. In the name select the variable you initialized in steps 2.6-2.7.
  4. In the value field paste in your HTML code.
Set variable and have it store the HTML code

Now you have created the condition and set the variable. This leads to the creation of the email message. To create the message you:

  1. Below the ‘Set email content’ action click ‘Add an action’.
  2. Choose Create a new record – Dataflex (Common Data Service current).
  3. For the email message choose the sender and receiver of the message. You must refer to the entity’s path as shown in the following screenshot. For more info about how this connector’s attributes are referenced see this article.
How lookup fields are referenced in the create a new record current action
How lookup fields are referenced in the create a new record current action
  1. Click ‘Show advanced options’ and add the email body to the ‘Description’ field, owner in the ‘Owner (Owners)’ field, the lead (‘/leads/{the lead GUID value}’) in the ‘Regarding (Leads)’ field, and the subject in the ‘Subject’ field.

The final step is to send the email. This requires a special kind of action called a bound action. To see the difference between bound and unbound actions please refer to this article.

  1. Below the ‘Create a new record’ action click ‘Add an action’.
  2. Choose Perform a bound action – Dataflex (Common Data Service current).
  3. In the Entity name choose Email Messages
  4. For the Action Name choose SendEmail.
  5. In the Item ID insert the Email Message ID. You find the ID by using the dynamics content and choosing the unique ID of the email message you created in steps 2.16-2.19 above.
  6. In the IssueSend select Yes.
Perform a bound action - Dataflex (CDS current) trigger
Perform a bound action – Dataflex (CDS current) trigger

3. Test the flow

You can now test your flow to see if everything works as it should. Do a test run on a lead in your Dynamics 365 Sales to verify that the flow runs when the custom field is changed on the lead and if the email is sent when the flow condition is true. For more information about performing the test, please refer to the blog post’s video above.

Categories
Dynamics 365

Follow your recipient’s activity in Dynamics 365

Tasks: Send a notification when a contact opens a Dynamics 365 attachment
Difficulty: Intermediate
Time to implement: 1-2 hours

In this post I’ll show you how you can use the Email Engagement solution, which I showed you how to configure in my previous post, to automatically sending a notification when a contact/recipient has opened a Dynamics 365 email attachment.

Tools

  • Dynamics 365 Sales: A popular CRM system from Microsoft that allows you to track your sales pipeline and activities, opportunities, and leads.
  • Email Engagement: One of Sales Insights’ solutions that enables you to follow emails in Dynamics 365 Sales. See my post Tracking opens and clicks of Dynamics 365 emails to see how it is enabled.
  • Power Automate: A service from Microsoft that allows you to connect different systems and create automated processes. In this example it is used to create a task and send a notification to the owner of a Dynamics 365 email message when an attachment is opened. In this post premium connectors are used that require a premium license for Power Automate.

Email Engagement follow up options

Email Engagement allows you to follow emails you send from Dynamics 365. It also gives you an option to set reminders to follow up on emails. The available options are:

  • If I do not receive a reply by
  • If the email is not opened by
  • Remind me anyway at
Set reminder options

The reasoning behind these options is that a salesperson wants to be able to follow up if there is no recipient activity. Another use case is when there is a recipient activity, the salesperson might want to follow up. E.g. when an email attachment containing a quote or a pricing is opened. The purpose of this exercise is to expand the current options to enable notification when a contact/recipient opens an attachment that is tracked via Email Engagement. To this end we will leverage Power Automate to send the notification.

A prerequisite to perform the work in this exercise is that you have already enabled Email Engagement in your Sales Insights settings, OneDrive integration in Dynamics 365, and that you have the appropriate licenses and permissions, of course.

Create and configure a flow

You start by navigating to flow.microsoft.com, create a flow from blank and choose the ‘When a record is updated’ trigger. This will open up the flow designer. To configure the flow you:

  1. Choose current environment in Environment.
  2. Choose Email messages in Entity name.
  3. Choose Organization in Scope.
  4. Under advanced options choose attachmentopencount. This lets the Flow know which fields on the email record you would like to monitor. In this case you want to monitor changes to the Attachment open count.

Next you insert a condition that checks if the number of opens your attachment has received is more than zero and that a category does not contain a specific value (we will come back to this later).

  1. Click on the ‘New step’ button.
  2. Select Condition.
  3. In the first condition insert Attachment open count equal to or greater than 1.
  4. In the second condition insert Category does not contain ‘Notification sent’.
When a record is updated trigger and the condition

When the condition is true you want the email notification to be sent. First you need to get the user information and then you will send the notification. Lastly you want to update the email message to ensure that the user doesn’t receive more than one notification.

  1. In the ‘If yes’ box click ‘Add an action’.
  2. Choose Get record (CDS).
  3. Choose current environment in Environment.
  4. Choose Users in Entity name.
  5. Put in the Owner of the email message as the Item identifier.
  6. Below the Get record action, click ‘Add an action’.
  7. Choose Send an email notification (V3). You might have to authenticate or accept to continue.
  8. In the To field insert the Primary Email from the user record.
  9. Fill in the subject and body of the email. You can use Dynamic content here which is recommended so the user knows which email/contact you are referring to.
Get record and Send an email notification (V3) actions
  1. Below the Send an email notification (V3) action, click ‘Add an action’.
  2. Choose Update a record (CDS).
  3. Choose current environment in Environment.
  4. Choose Email Messages in Entity name.
  5. In the record identifier put in the Email Message ID.
  6. Click ’Show advanced options’ and type in ‘Notification sent’. This is necessary to indicate somewhere on the record that a notification has been sent to the user. You can use any field. In this case I am using an OOB field called Category. If you are using Category for something else you may consider creating a custom field to store this value.
  7. Click Save to save your flow.
Update the Email Message

Testing the flow

You can now test your flow to see if everything works as it should. Do a couple of test runs on the same email message to verify that only one notification email is sent when an attachment is opened multiple times (note that the email must be sent through Dynamics 365 with a followed attachment). For more information about performing the tests, please refer to the blog post’s video above.

Categories
Dynamics 365

Tracking opens and clicks of Dynamics 365 emails

Task: Enable and configure Email Engagement to follow emails
Difficulty: Medium
Time to implement: 1-2 hours

In this post I am going to show you how you can follow emails in Dynamics 365 Sales. This is a very useful feature that is part of Sales Insights (free) solutions.

Watch the video

Tools used

  • Dynamics 365 Sales: A popular CRM system from Microsoft that allows you to track your sales pipeline and activities, opportunities, and leads.
  • Sales Insights: Free solutions that come with your Dynamics 365 Sales subscription.
  • Email Engagement: One of Sales Insights’ solutions that allows you to follow emails in Dynamics 365 Sales.

Enable Sales Insights

First I’ll show you how to enable Sales Insights:

  1. Navigate to Sales Hub.
  2. In the switch area choose Sales Insights settings.
  3. Click on the Accept Terms button.

Enable Email Engagement

Once you have enabled Sales Insights, you can enable the Email Engagement solution.

  1. Navigate to Sales Hub.
  2. In the switch area choose Sales Insights settings.
  3. Click on the Grant permissions button. Once you have granted the permissions this button changes to Set up.
Email engagement
Grant permission for Email engagement
  1. Click on the Set up button
  2. Switch on the Enable email engagement. Now you have set up the Email Engagement.

Create and send an email message

To test the solution you need to send a test email. You can send it to yourself. You do this by:

  1. Navigating to a contact record in Dynamics 365 and creating an email message on the contacts timeline. Try adding a link to the email message.
  2. Send the email message and once it has been sent, open it and click the link (you have to have sent to yourself to do that).

View the opens

To view the opens you have two options. Either view it directly from the contact’s timeline or from the All Followed Emails view on the Activities page.

To view it from the contact record:

  1. Navigate to the contact you sent to. You can see in the Timeline that the email has been sent and that it has been opened (if you followed step 3 in the previous section).
follow email results
Viewing the opens from the contact’s timeline

To view it from the Activities page:

  1. Navigate to the Activities page.
  2. Select the All Followed Email view. You can see four metrics that belong to the Email Engagement solution, Open count, Attachment open count, Links clicked count, and Reply count.

Author’s comments

I used a template in my testing and it appears that links inserted into a template for reuse are not tracked by the Email Engagement solution. Therefore, it is recommended to always manually inserting a link even when using an email template. This is something that Microsoft should consider improving on their side.

References

https://docs.microsoft.com/en-us/dynamics365/ai/sales/email-engagement

Categories
Dynamics 365 Integration

Integrate your website with Dynamics 365 Sales

Task: Integrate your website with Dynamics 365 Sales using Parserr parsing software
Difficulty: Advanced
Time to implement: 1-2 hours

I am quite excited about sharing with you a great discovery I made when surfing the web looking for new ways to handle automatic record creation in Dynamics 365 from emails messages. In my research, I came across a parsing tool that enables you to create any record in Dynamics 365 based on form submissions and email messages.

Categories
General

Creating a Canvas App

Task: Create an app that allows employees to order food at the office canteen
Difficulty level: intermediate
Time to implement: 2-3 hours

In this post, I will show you how to create an app that allows your employees to order food at the office canteen. Many offices order food from catering services. The catering service may or may not have an interface for employees to register or order food. In some occasions, the administrative staff has to collect the food orders and send it to the catering company. To make this process more efficient we will give our employees access to the app and allow them to choose between a couple of menus for a given week.

By finishing the following steps, you will have a basic understanding how to create a Power App and can start to build your own custom apps tailored to your company’s needs.

Table of contents

Tools used for the app

  • Canvas apps
  • Common data service

1. Creating the app

  1. Go to make.powerapps.com → Apps.
  2. Click New app → Canvas. This will take you to the create.powerapps.com where you will create your app.
This image shows how to add a new canvas app in the Microsoft maker experience.
Add a new canvas app
  1. We will be creating an app based on data in Common Data Service (CDS), so we will choose to create an app in our environment using CDS.
  2. Under Common Data Service, choose Phone layout.
This image shows how to create a canvas mobile app from data in common data service.
Choose a data source/layout
  1. A list of connections are presented. Under the Common Data Service connection, choose an entity. If you don’t have the connection you’ll have to create one. In this case, I have created a customer entity called Food Orders.
This image shows how to create a canvas app from data in common data service.
Choose a table/entity
  1. Give your project a name by navigating to File → Settings and changing the name field. By default it is named App. I’ve named mine CanteenApp.
  2. Navigate to Save and click Save in the bottom right corner
This image shows how to name a canvas app file and save it.
Name and save your app

2. Customize the app

After you have created your app, you can start customizing the views and forms of your app. Similar to Dynamics 365, you edit the forms, e.g. rearrange fields and add/remove fields.

First, I’ll start with the list view as I want to control how this screen appears to the user. I want the view to be called Order Food instead of Food Order because we want the user to perform an action in the system, i.e. order some food from the canteen. To do this you:

  1. Have BrowseGallery1 selected on the left navigation.
  2. Click on the name. It is by default named after the table/entity. I’ve named my app ‘Order Food’.
This image shows how to rename a canvas app.
Rename the app
  1. Next, navigate to BrowseGallery1 → Layout and select the layout you like. In this case I have chosen a layout with an image.
  2. After you have given your app a title and chosen the layout, you’ll want to save our app. Repeat step 1.7 to do this. In the next step you will change the details and edit views of your app.
  3. In the Tree View menu navigate to → DetailForm1. You can do this by scrolling with your mouse or typing into the Search window.
  4. Under Properties navigate to → Fields and click on Edit Fields.
  5. Add the fields that you would like to see on the details view. This is the view the user sees when he clicks or taps on the Food Order item.
This image shows how to edit fields on a canvas app form.
Editing fields on a form
  1. Find the EditForm1 and Redo steps 2.5-2.7. Usually you want to display the same fields on an edit form as you do on a details form. This is expected behavior for a user. In the video at the end of this blog post, you can see how the app looks from the user’s perspective.

3. Publish the app

I assume that if you are like me, you want to polish the app to make it look a bit nicer. That’s fine. Once you are happy with how it looks (or perhaps you wan’t a colleague to test it for you), you can go ahead and publish the app.

  1. Navigate to File → Save to save your app.
This image shows how to save a canvas app.
Save the app
  1. As soon as you have saved the app you’ll see that a Publish button appears. Click on Publish. This will open a pop up window where you can add some information, publish the app or edit details.
  2. Choose Publish this version.That’s it. Your app has been published.
This image shows how to publish a canvas app
Publish the app

4. Share the app

The final step of the process is to share the app to get people to use it. If it is your first app, you will probably receive feedback for improvements. Don’t take it personally. Feedback is good when it comes to software because this way we can improve our product. Let’s go a head and share it with a colleague.

  1. Assuming that you are proceeding from Section 3 where you have saved and published the app. A screen appears where you have published the app offering you to share the app. You will see an option to share the app or see all versions of the app.
  2. Click on share.
  3. Type in the name or email address of the person who will receive the app. This contact has to have a license for Power Apps to be able to use the app.
  4. Select the user by clicking on the record.
  5. Assign a security role and click Share. Congratulations, you have now created, customized and shared a mobile app.
Image showing how to share a canvas app
Share the app

Please note that Jon (or whoever you share the app with) will require a security role and the appropriate permissions to be able to use the app for more information see Microsoft docs.

If you like this tutorial please subscribe to my Youtube channel and blog. Also, if you wan’t to create this app I created (see video below) feel free to contact me on the website and I’ll send you the solution file and share with you the template for the app.

If you want to study Power Apps there are plenty of resources online. I’ll leave a few links at the end of the post.

Video

Chek out the video

Online resources on Power Apps

Categories
General

My post about Net Promoter Score on CustomerThink

A post written by myself just got published on CustomerThink, a highly ranked blog site. In the post I am discussing the benefits of using and implementing net promoter score to measure how satisfied customers are with your company’s products or services.

Furthermore, the article has been published as an Editor’s Pick giving it a more prominent place on the website as well as it will be featured in the blog’s weekly newletter next week.

As a taken of my appreciation, Stirna has decided to offer CustomerThink subscribers an hour of consultation for free! You can see the offer on CustomerThink’s Marketplace (valid until end of July) and you can subscribe to their newsletter here.

Categories
Dynamics 365

Customer survey sent after purchase part 3/3: Configure a flow

Task: Automatically send customer survey after an opportunity is won
Difficulty: Medium
Time to implement: 1-2 hours

Content

  1. Creating the survey
  2. Configuring the email template
  3. Configure a flow

In this article we will conclude this blog series by configuring a flow for our survey in Power Automate.

Categories
Dynamics 365

Customer survey sent after purchase part 2/3: Create an email template

Task: Automatically send customer survey after an opportunity is won
Difficulty: Medium
Time to implement: 1-2 hours

Content

  1. Creating the survey
  2. Configuring the email template
  3. Integration

In this article we will continue working in Forms Pro and build an email template with dynamic content from Dynamics 365.

Categories
Dynamics 365

Customer survey sent after purchase part 1/3: Create the survey

Task: Automatically send customer survey after an opportunity is won
Difficulty: Medium
Time to implement: 1-2 hours

Content

  1. Creating the survey
  2. Configuring the email template
  3. Integration

In this three-part blog series we’ll be looking at a scenario which I have implemented for a client where a car dealership selling a new car sends a survey post-purchase to a customer and asks about his experience with the purchase and how likely he will recommend the company to his friends.

Categories
Dynamics 365 Microsoft Forms

Lead generation with webforms part 3/3: Connecting with Dynamics 365

Task: Create a lead in Microsoft Dynamics 365 Sales from a web form submission
Difficulty: Easy
Total time to implement: 1-2 hours

Content

  1. Creating the form (read post)
  2. Embedding the form on a webpage (read post)
  3. Connecting the form with Dynamics 365
    1. Creating a flow
    2. Configuring the flow
    3. Testing the flow

In this last part of my three-part blog series, I’ll show how you can leverage a Microsoft Power Automate flow to automate the task of creating a lead record from a form submission. While in previous posts we have already created a web form, published it and embedded on a webpage, in this post we will create a flow that will create a lead record in Dynamics 365 Sales and send a couple of emails.