Getting started generating a campaign


Re: Getting started generating a campaign



I did what you suggested.


I also had to make a change to the source code where the require once was.


With those three changes made, the form was presented, which I filled in see the attached file.


That gave me the error screen.


 Array ( [0] => Array ( [error_key] => json.regex.mismatch.email_content [error_message] => #/email_content: This attribute value must be of the format '...' ) )


I think I'm likely going about this in a round-about way and looking to adapt far more complicated code than I need.


I was able to get a post to work in the try it API page. My project is very much like that page in that what I am trying to do is to created a simple email that will notify people of the availabiliy of a daily Bible reading along with a url they can click on to take them there. The contact list is already in place. That's it. I don't need a form. The data is available in the program from a MySQL database which contains the day and date of the reading as well as the passage. These are stored in PHP variables awaiting to be used  to make the contents of the email.


That's all there is to this whole project.



Form Data.jpg
CTCT Employee

Re: Getting started generating a campaign

You're actually very close. That error message is just letting you know that the email content needs to be wrapped in html and body tags, ie:

<html><body>This is my HTML content</body></html>


The form in the example is just meant as a demonstration of how one could create and schedule an email campaign. You can pull out portion of the code that actually does the creation and do without the entire form if that's what suits your needs. 

David J

View solution in original post


Re: Getting started generating a campaign

Thanks, that was the trick all right!


So, what I am thinking I could do then is to strip out the form coding and use this code, just substituting my data from the variables in place of the form data to create the associative array from which the email campaign is created and scheduled. Does that sound like a good approach?

Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More