Manage Email Bounces on Lead or Contact Views & Forms in Dynamics 365 Customer Insights - Journeys
Another one from the leaderboard of reasonable questions asked by customers which I previously didn’t have a reasonable solution for (but now I do!).
How can we manage email bounces?
Previous me:
a) Well you can go through the email analytics and look at the list I guess? Yes you have to go through each email seperately sorry.
b) Or here’s a segment of all bounces in the last x days. But you can’t see which email bounced, or when or why. And the segment won’t remove them from the list until the time period lapses.
c) Oh you want to use a view? Nope sorry!
Current me:
Last bounce date and reason on each Lead/Contact with email delivery issues? EASY!
You will need to create some new fields to store the data. Bounce type is probably always going to be ‘Hard’ or ‘Soft’ but the category & details I left as safer free text option. But Category could also easily be a choice column for better filtering/reporting, you just need to make sure you include bullet proofing for when a new category comes in which is not in your choice values.
Last Email Bounce Category - Single Line of Text (increase maximum character count to 1000 to be safe)
Last Email Bounce Date - Date Time
Last Email Bounce Details - Text Area (increase maximum character count to 1000 to be safe)
Last Email Bounce Type - Choice ‘Hard’ or ‘Soft’
The example for adding fields in shown for the Contact table, but the flow works for Leads and Contacts so you will need to repeat the field creation on the Lead table too.
It turns out it’s as easy as a two step flow to update any lead or contact when an email bounce occurs. There is an ‘Email bounced’ action that is triggered whenever an email bounce occurs in Customer Insights - Journeys and returns lots of juicy data. So you just need to do something useful with it. I highlighted the important bits below, but obviously you can sue whatever you want from there.
Action: Update a row - Dataverse
We have all the data we need to use a single action to update leads or contacts (assuming the field names are the same on each table. You will need to replace the amey_ field names with your field names and chack the values 1/2 relate to your Email Bounce Type choice values. Scroll down for the copy paste friendly expressions!
Table name: concat(triggerOutputs()?['body/InputParameters/msdynmkt_entityid/LogicalName'], 's') Row ID: triggerOutputs()?['body/InputParameters/msdynmkt_entityid/Id'] Row item: { "amey_lastemailbouncetype": @{if(equals(triggerOutputs()?['body/InputParameters/msdynmkt_bouncetype'], 'Soft'), 1, 2)}, "amey_lastemailbouncedate": "@{formatDateTime(triggerOutputs()?['body/InputParameters/msdynmkt_originaltimestamp'])}", "amey_lastemailbouncecategory": "@{triggerOutputs()?['body/InputParameters/msdynmkt_category']}", "amey_lastemailbouncedetails": "@{triggerOutputs()?['body/InputParameters/msdynmkt_details']}" }
That’s it for capturing the email bounce details. For testing this I recommend you don’t use your own domain to purposefully cause email bounces as it’s not good for your domain reputation. Either use a very small sample (1-3) of bad email addresses or use the default domain of your marketing implementation which is usually something like unqbaeb45542343242e7fca.s02.dyn365mktg.com.
How about an indicator as to whether the email address has been updated since the last bounce also? SURE
It's great to be able to create a filtered view of the contact email addresses that need to be reviewed, so you can also add a data point to track when the email address was last updated. If the email address has been updated since the last bounce then we can remove them from the list until another bounce occurs.
You will need to create some more new columns to store the data. Again the example for adding fields in shown for the Contact table, but the flow works for Leads and Contacts so you will need to repeat the field creation on the Lead table too.
Previous Email Address - Email Address
Email Address Changed Date - Date Time
Email Address Bounce Review Required - Formula (Yes/No)
If(('Last Email Bounce Date'>'Email Address Changed Date') || (!IsBlank('Last Email Bounce Date') && IsBlank('Email Address Changed Date')),true,false)
Capture Previous Email and the Date/Time it was changed
To capture a value before it is changed, we can’t use flow. We could use a low code plugin but preview features are not for real life things, I have absolutely no idea how to create a real developer plugin, so instead we get to use a good old classic workflow.
Create a new Process ‘Worflow’ and make sure ‘Run workflow in the background’ is NOT checked.
Before the process runs we jut want to check that the current and previous email have different values, and then update the ‘ Previous Email Address’ & ‘Email Address Changed Date’ columns
Make sure you activate your workflow and add the new columns to the form as read only.
What a beauty!
That’s it, go clean up your database and no excuses!