Personalisation is the essence of email marketing. Making your messages relevant to your audience increases engagement and conversion rates. In Dynamics 365 Marketing it’s easy to add ‘simple’ personalisation into an email – for example to personalise the subject line with the contact’s name.
But what about more complex personalisation – such as rotating which image or messaging is presented according to the contact’s occupation? You could – if you wanted to, create multiple versions of your email, each with the appropriate content for the audience. Or, you could use a Custom Code block.
Custom code blocks are an OOTB design element in Dynamics365 Marketing. Simple drop the Custom code tile onto the design canvas and you’ll add a Custom Code content block.
Now for the (only) tricky bit – you need someone with a knowledge of Java coding to write you a short script. The example we’re using here is to rotate an image based on the contact’s last name (but it could be any field on the contact record). This code took one of our Developers just a few minutes to write and test.
Now, it’s just a simple cut & paste of this code into the Custom Code properties box.
Create the rest of your email, ‘Check For Errors’, and assuming all is OK, do test sends to confirm the variants are working – making sure that one of your Test Contacts meets the condition (in our case, Lastname = Bastow), and that one doesn’t.
Check your email account for the test sends, and voila – the appropriate image appears, automagically. On my test emails there was a very short pause in email rendering for communication back to the server, but nothing really noticeable.
This is a pretty simple example to show the principle. For another example (and with thanks for the inspiration), check out this post by Vincent Groenheijde on the Dynamics 365 Marketing Community Blog (here) on personalising an event confirmation with the relevant sessions that a contact has signed-up for.