Modifying template on the fly with external data using php?


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. might have the following locations - location1 - location2

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, 8 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:
We're also on Facebook:

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free