Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

Sending unique coupon codes to each contact from a database.

IrfanA513
Rookie
0 Votes

Hi,

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?

Thanks,

1 REPLY 1
Courtney_E
Moderator
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

https://v3.developer.constantcontact.com/api_guide/index.html

 

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

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

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

 

POST (create) a Contact

https://v3.developer.constantcontact.com/api_reference/index.html#!/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

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

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

 

Create an automated email series

https://knowledgebase.constantcontact.com/articles/KnowledgeBase/27935-Choosing-a-Trigger-for-Your-A...



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

 

Regards,

Courtney E.

Tier II API Support Specialist 


Regards,

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.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

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

Sign Up