Sending unique coupon codes to each contact from a database.

0 Votes


I use an sql database and I have a customer table. I also have a coupons table which have a list of unique coupon codes for each customer. Is there a way to automate the emails with my database or a spreadsheet?


0 Votes

Hello  IrfanA513,


Thank you for reaching out to Constant Contact API Developer Support, my name is Courtney. My team is here to assist outside software developers with questions about building into Constant Contact's API.


This can be accomplished by importing the contact data with the unique coupon code as a Custom Contact Field, and then setting up an Automated Series within your Constant Contact account that uses those Custom Contact variables to send out a personalized email automation.


To accomplish this using the V3 API (rather than doing it manually), when developing your application you’d want to set up a contacts sync that includes the unique coupon codes for each customer as a Custom Field, and to have them be added to a specific list associated with the automation that you are wanting to send.


Getting Started with V3 API


Use this flow to add/update your contacts which incorporates three contact endpoints:


Step 1: Check to see if the contact exists in the account


GET a Contact!/Contacts/getContacts


Step 2: If the contact comes back as non-existent, use POST to create the contact:


POST (create) a Contact!/Contacts/createContact


Step 3: If the contact comes back as already existing in the account. You need to append the returned data with the desired list memberships and send that back with PUT to update the contact:

*When Updating a contact, we need to append the new information to the old information and send all of it back in the request, because when you update a contact using a PUT, all properties are updated, overwriting all existing property values. Any properties left blank or not included in the PUT will be overwritten with a null value.


PUT (update) a Contact!/Contacts/putContact


The list join series and associated list will need to be created within the UI.


Create an automated email series

Please have a look and let us know if you have any other questions!



Courtney E.

Tier II API Support Specialist 


Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Developer Portal

View API documentation, code samples, get your API key.

Visit Page


API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up

How confident are you about the effectiveness of your current marketing strategy?

Top Choice: Not confident at all (66%)