The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Newsletter content from Drupal

Highlighted
Occasional Contributor

Newsletter content from Drupal

Can I use the API to grab the content for the newsletter from Drupal.

 

Say - we will have a php script in drupal that will pull the 5 latest articles and then constant contact should pull this data

8 REPLIES 8
Highlighted
Employee

Re: Newsletter content from Drupal

Hi,

 

You can push the data to us through the API.  Say you wanted to create and schedule an email in Constant Contact based on the content pulled with drupal.  You would pull the content, put the content into your own html, and then create the email through our API, providing us with your HTML for the newsletter.  You would them make a second call to schedule the email through our API.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Newsletter content from Drupal

Thanks!

 

Is there documentation for this process?

Highlighted
Employee

Re: Newsletter content from Drupal

We don't have documentation for the process of pulling content from Drupal and putting it into an HTML email, but this is our documentation on creating and scheduling emails through the API.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Newsletter content from Drupal

Thanks again.

 

So essentially I would do something like this - http://community.constantcontact.com/t5/Documentation/Campaign-Resource/ba-p/25109

 

Add my html to within <EmailContent></EmailContent> - create a new campaign and then schedule an email, right?

Highlighted
Employee

Re: Newsletter content from Drupal

You're welcome.  Exactly, you want to put you html in the EmailContent node.  One side note, you will need to html encode the email (the part within the emailcontent node), like what would be accomplished on this page:

 

http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx

 

Of course, many libraries have html encoding methods that you would want to use instead of doing it manually.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Newsletter content from Drupal

Great!

 

I am looking for two such emails to go out every day and everyday we will have the php script pull the content for the newsletter. 

 

Can I schedule the email from the same script I create the campaigne i.e., it should shcedule the email as soon as the campaign is created

Highlighted
Employee

Re: Newsletter content from Drupal

Yes, you can create and schedule the email right afterward.  It would be a good idea to put in a delay of 60 seconds between each call to make sure we've processed the create email request before trying to schedule it.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Newsletter content from Drupal

Thanks so much!

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured