This repository contains starter code for creating dynamic images for email that utilize ESP merge tags to superimpose subscriber data, such as "First Name", into images effectively creating hyper-personalized content.
The code used for this specific implementation is PHP. In order to use this code, it will need to be uploaded to a server that can run PHP code. For local testing, you can install MAMP or other software that allows you to run an instance of a server on your computer that can run PHP code. With that said, here's now to use this code:
- Download, install, and start up MAMP.
- Download this repo and unzip it in the 'htdocs' folder under the MAMP directory.
- In a browser window, navigate to
http://localhost/fname/simple/
orhttp://localhost/fname/extra/
depending on which code you want to test out. - Have fun!
The code in each of the versions is pretty well commented, so if you want to experiment with your own images/fonts/whatever, you should be able to modify things to your liking. If you're having trouble, there are plenty of resources available on the internet that can probably help you achieve what you want.
Depending on how your live server is set up, you may run into errors or other issues, or need to make changes to get it to run. Most of the time, you should be able to troubleshoot using the error messages thrown by the script.
-
Simple version: https://ryanfield.ca/fname/simple/
-
Extra version: https://ryanfield.ca/fname/extra/
The alphabet letters in the extra version were created by Marco Verch (https://www.flickr.com/photos/30478819@N08/29987542637) under the CC BY 2.0 license (https://creativecommons.org/licenses/by/2.0/).
The font used in the simple version is Comic Neue by Craig Rozynski and others (http://comicneue.com/).