Modifying template on the fly with external data using php?

Hi,

I'm just having a hard time trying to figure this out. I'm not sure if this is even possible or not. Basically, we have a list of subscribers in CM. This contains the basic name,email with an additional company field.

Now, in our production server we have a database with the list of subscribers as well. In this case however, we have email and location. Location can be multiple instances e.g. john@abc.com might have the following locations

john@abc.com - location1
john@abc.com - location2
etc...

So at the moment I'm using the API to pull the list of active subscribers. This is easy. I then use the email as an identifier to get the locations list for each of the subscribers.

Now, getting to my actual question. How can I pass this list of location to a template and send the campaign with this extra data based on the subscriber, so the template would look like this:

Dear [name],

You are currently in {locations}

Where {locations} is the modified data parsed from my own php script. Is this even possible? I apologize if this is not well explained.

Thank you.

Mathew Mathew, 6 years ago

I'm not 100% clear on what you need to do, but could you have 'locations' as a custom field in your list, with one or more values for that field, per subscriber.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098