Attention! Emergency…content block needed — Ampscript

Alessia Mastroianni
6 min readOct 21, 2020

I worked on this solution for an NFP client that dealt with emergencies on a regular basis. Every time there was an emergency appeal, the marketing team felt under pressure. The emails needed to be sent before the news hit the major media in the UK.

However, this was extremely complicated with the automation system they were using and when they decided to move onto Salesforce Marketing Cloud (SFMC), this was one of their main requirements.

In addition - in case of emergencies - all other communications will be deprioritised or blocked.

I had two problems to solve:
1) How do I ensure efficiency (the email should be created in a matter of minutes)
2) How do I allow other communications (e.g. Journey’s automation) to be sent, but give priority to the emergency

These are the marketing cloud component used to meet the above requirements.

SFMC components

In order to achieve efficiency, I recommended building a series of pre-built templates that could be used for emergency communications.

Each template was built using Marketing Cloud content blocks that can be easily moved, duplicated, edited and deleted using the WYSIWYG (what you see is what you get) editor. These templates will serve as a base.

Now let’s improve efficiency even more. I knew I could achieve this by reducing the number of interfaces the marketing team had to check to complete the creation of the emails.

Therefore I created a generic piece of ampscript that could be included inside the email template and would be dynamically populated with the emergency block relevant for that day.

Ampscript for emergency block

The ampscript logic uses a Lookup Ordered Rows function with the following properties:
1. Name of DE — (Emergency_Master)
2. Number of rows to return. Specifying 0 or -1 returns all matching rows. (The maximum number of…



Alessia Mastroianni

Marketing Automation Architect working at Salesforce. 6x Salesforce certified. Salesforce #MarketingChampion 2020.