Mautic, Open Source marketing software, can be used to send targeted emails about events to people on your mailing list who live within a radius of that event.
For example, my partner and I attend vegan fairs all over the country and like to invite our customers to attend: they can buy postage free, access special offers and of course we get to put a face to a name.
The best thing about this process is the lists will always be up to date when you need them: each new contact you get who lives in the specified radius will be added to the list. Next time an event is in the same area you have a list ready and waiting.
Here’s how it’s done.
- You need the postcode of your event
- You need the postcodes of those on your email lists
- You need mautic installed and working
Get the postcode data
Find the postcode of your event, for example, we are attending the Glasgow Vegan Festival at the Trades Hall Of Glasgow, G1 1UH.
Use a postcode radius tool to get a list of all the postcodes within a radius of the venue. I used freemaptools.com and set the radius, in this case, at 60 miles.
Clean up data
For the sake of simplicity, we will only use the first two letters of the postcode – while this will widen the area somewhat, it’s much quicker to set up in Mautic. It’s the difference between adding hundreds of filters to a list, or just a handful.
Remove extraneous data
The list of postcodes produce looks like this: DG10,93.50,58.10 so we need to remove the one or two numbers after the letters, plus the coordinates after that.
To do this I used find and replace with various regex strings in a text editor. For detailed instructions, you can read more about this kind of process here.
You can run replace [0-9] with blank and then replace ,.,. with blank, it’s the quickest way, but I did things the long way round to allow me to be sure I wasn’t removing things inadvertently.
- ,[0-9][0-9].[0-9][0-9],[0-9][0-9].[0-9][0-9] replace with blank
- ,[0-9][0-9].[0-9][0-9],[0-9].[0-9][0-9] replace with blank
- ,[0-9].[0-9][0-9],[0-9].[0-9][0-9] replace with blank
- and finally [0-9] replace with blank**
** before you do step 4, just check there are no single letter postcodes in your list – these are like G83. These need to be dealt with separately. If you have them, continue as directed, but there will be an extra step at the end.
Now, our list looks like this:
At this point, if you have single letter postcodes like G38 you will end up with a single letter like G in the list. These need to be added in a different way. This is because G is the start of many other post codes in the UK, like GU, which are not in the same area as G. More on this later…
Set up the segment in mautic
Create your list with a clear name for future use, for example, I called mine “Glasgow postcode list” and added a description, As these lists are designed to be used many times, it’s important to document them.
Next, on the Filters tab, add the filter Zip Code
TIP: make sure to choose Zip code contact (little guy icon) not zip code business (building icon)
Then select Starts with from the dropdown
TIP: Rather than scrolling down the list each time, you can hit the s key then hit enter and it will select Starts with.
Add all the two letter codes, with or as the separator (rather than and).
Finally, if you have single letter postcodes, these need to be added with letter-first-number. Like G1, G2, G3 etc.
Check all is correct
It’s worth taking a few moments to check that
- All the fields are contact zip (little person icon) not company zip (building icon)
- All are set as or not and (and will be indented)
- All are starts with not anything else
When you have checked, Save the segment and wait for it to fill up (this depends on your cron schedule).