Daily emails with dynamic contents fetched from our database automatically

Regular Participant

Daily emails with dynamic contents fetched from our database automatically

Hello,

 

We want to use ContantContacts for sending different newsletters emails to a big (30000+) list of users. Following are some more details:

 

There are different newsletter emails -

1. Daily newsletter - Sending quote of the day.

    a. We will set the HTML format of the email

    b. Same email format but contents will be fetched from our database and go in email automatically on daily basis

2. Weekly newsletters:

    a. We will set the HTML format of the email
    b. Our Admin will select which content to be sent

    c. Will select the list of members for sending email

3. Manual:

    a. We will set the HTML format of the email
    b. Contents and members will be selected by Admin

 

Our end customer has already spoken with ContantContact support and is very happy with the pricing and other feature.

 

Please please guide us on how this will work using contantcontacts.

 

Best Regards,

 

Dnyanesh

 

19 REPLIES 19
Moderator

We have a couple of options for you.

 

1. Use our UI to manually create these emails in a template or custom code.  This uses our basic UI functionality and requires no development.  It is likely to be tough to get the info from the SQL database daily but not impossible. 

 

2. Use our API to build a custom integration for creating and sending the email campaigns.  This is an advanced option and requires custom coding from a developer on your side.  If this is interesting to you and your client, you can find our documentation on creating and scheduling an email campaign here:http://developer.constantcontact.com/docs/email-campaigns/email-campaign-api-index.html

 

We also have wrapper libraries to speed up development in PHP, C#, Ruby, Java and ObjectiveC.  If you run into any problems using our API we can certainly support that.  However, we are not able to support custom HTML designs and issues with HTML development of the actual newsletters.  Hope this helps!

Dave Berard
Senior Product Manager, Constant Contact

Thanks Dave!

 

You mentioned that getting data from SQL Database is tough but not impossible. Would like to know more about this on how to achieve it.

 

Best Regards,

 

Dnyanesh

 

It was in the context of a non-developer doing that.  Programatically, it's pretty simple to get content from the SQL database.  But if you have someone manually pulling that content from the SQL database, logging into Constant Contact and copy/pasting the content in, that can be tedious.  If you have a system admin or a developer doing that, it could also be fairly simple.  All depends on who the target user is doing the manual pulling of the content and doing the copy/paste.

Dave Berard
Senior Product Manager, Constant Contact

We are a development company and will do pulling from SQL. But how to pass it to the palceholders in the email template is a query now.

 

Best Regards,

 

Dnyanesh

 

We don't have any options for placeholder text.  The two options we offer are:

 

  1.  WYSIWYG authoring environment.  Manually create a template, use a WYSIWYG editor to customize the email including copy/paste of any content from 3rd party sources (such as your SQL database).  Manual customization of all content through our WYSIWYG editor tools with optional code view if you want to dig into the raw HTML of the content and customize to some degree.
  2. Custom Code experience.  Send us a complete and ready to send HTML document and all of the related data (subject, to, from, etc.) through the API or through our UI by copy/paste.  No access to templates or our WYSIWYG content is possible through this method.  Everything must be designed and built outside of Constant Contact and sent to us complete and ready to go.  This is the option you would take if you wanted to fully automate everything through a custom developed solution using our API.  No merging needed as the HTML document must be supplied to us as an entire entity including all content.

Does that make sense?

Dave Berard
Senior Product Manager, Constant Contact

Hi Dave, 

 

We will try these options and let you know if we need anything more. 

 

Thanks for your support! 

 

Best Regards, 

 

Dnyanesh 

 

Regular Participant

Hi Dave,

 

I am Vijay, working with DnyaneshG.

 

While trying Create and Schedule a Campaign API, I am getting below error:

 

Error Creating Campaign

 

Array
(
    [0] => Array
        (
            [error_key] => http.status.bad_request
            [error_message] => Please enter an address
        )

)

 

 

for attached email template.

Could you please let me know what is remaining to complete from my account settings?

 

my username is aressvijay

 

 

Thanks

Vijay

 

 

 

 

 

 

Haven't had a chance to run it through on my side but looking at the page source there is white space after the closing </html>.  If removing that doesn't fix the problem for you, let me know and our support staff will try to run it through our API.  It would be very helpful if you could email us your JSON payload that is failing to webservices@constantcontact.com.

Dave Berard
Senior Product Manager, Constant Contact

Hi Dave,

 

Thanks for quick replay!

 

Is this something related to my account settings?

 

By reading community posts I got to solve the html tag related issue.

 

Now I am getting below error:

Array
(
    [0] => Array
        (
            [error_key] => http.status.bad_request
            [error_message] => Please enter an address
        )

)

 

I believe this is something related to my account setting.

 

Please advise.

 

 

Thanks

Vijay

 

Every email campaign is required to have a Physical Address per CAN-SPAM legal compliance.  There are two options for having this supplied to a campaign:

 

  1. Default address for the account.  If you want to use this, you need to have set your default address and you would need to leave the footer object blank.  
  2. Set the address explicitely in the footer object.  If you don't want to use your default address, or haven't set one, you will need to set the required fields in the footer object.
Dave Berard
Senior Product Manager, Constant Contact

Hi Dave,

 

As per your advise,

 

I have checked my account setting and filled my physical address.

 

But I am bit confused about to "leave the footer object blank." from your comment.

 

From where I can do this?

 

I am using API to create campaign and getting the same error message: "Please enter an address"

 

Do I need to pass address to API? if Yes please guide me to set it.

 

 

Please advise.

 

 

Thanks

Vijay

 

 

Regular Participant

Hi Dave,

 

Please reply.

 

I am struggling to create my first campaign.

 

Thanks

Vijay

 

In the Campaign Object you'll find a MessageFooter object: https://github.com/constantcontact/php-sdk/blob/development/src/Ctct/Components/EmailMarketing/Messa...

 

You can set the address in there manually OR leave the entire MessageFooter object as a null.  

Dave Berard
Senior Product Manager, Constant Contact

Hi Dave,

 

As per your instructions I have sent mail to webservices@constantcontact.com as below:

 

We are facing 2 technical issues:

1. In our test account I have created 2 Contact  Lists.
    - Positive Quotes
    - Test Contact List
    - General Interests (Default by Constant Contacts)


I have deleted all above lists and created new one:
    - Attitude media Positive Quotes


But the API: getLists is still returning old lists that are deleted from my account.


Currently In our test account we have single Contact list present but API is returning below output:

Array ( [0] => Ctct\Components\Contacts\ContactList Object ( [id] => 1730711799 [name] => Positive Quotes [status] => ACTIVE [contact_count] => 1 ) [1] => Ctct\Components\Contacts\ContactList Object ( [id] => 1652783755 [name] => General Interest [status] => ACTIVE [contact_count] => 2 ) )

And a weird thing is, it is not returning the list that is currently present in our account.
Please let me know what settings are remaining from our account to get updated data through API?

 

 

2.   This point to related to From Email and Reply to Email.
We  have 2 emails configured to send emails:
 
We have tried both emails as a From emails and Reply to Email but for both email addresses we are getting error message:

Array ( [0] => Array ( [error_key] => http.status.bad_request [error_message] => Please enter a valid email address. ) )

Note: Both emails are verified emails.

Please provide solution for above points it is now urgent for us.
 

Thanks
Vijay
Regular Participant

Hi Dave, 

 

We are not able to get this through yet. 

 

Please guide us on this, our customer is chassing us like anything... Need your support. 

 

Best Regards, 

 

Dnyanesh 

 

Regular Participant

Hi Dave,

By using API and the official PHP library, I have completed to create contact lists, contacts, update contacts operations.

I have also able to create new email campaign by using API, but it is throwing below error while scheduling the created campaign.

Fatal error: Call to undefined method Ctct\Services\CampaignScheduleService::addEmailCampaign() in /var/www/html/newattitudemedia/blog/wp-admin/src/Ctct/ConstantContact.php on line 355

Please check and advise for the fix.

I have attached is the zip of my script.

my api_key is: <redacted>


Please advise, its urgent for me.

Thanks & regards,
Vijay

Hello Vijay,

 

After reviewing your code, I was able to find the problem in your version of ConstantContact.php. In this file, there is a method called addEmailcampaignSchedule that appears to have been changed from the original code. This change is what is causing the error that you are seeing.

 

Here is the code that you are using:

    public function addEmailCampaignSchedule($accessToken, $campaign, Schedule $schedule)
    {
        $campaignId = $this->getArgumentId($campaign, 'Campaign');
        return $this->campaignScheduleService->addEmailCampaign($accessToken, $campaignId, $schedule);
    }

 And here is the code taken from our Github repository:

    public function addEmailCampaignSchedule($accessToken, $campaign, Schedule $schedule)
    {
        $campaignId = $this->getArgumentId($campaign, 'Campaign');
        return $this->campaignScheduleService->addSchedule($accessToken, $campaignId, $schedule);
    }

 

If you adjust your code to use the same method call as the second example shows, then it should start working as expected. Also, it may be a good idea to download a fresh copy of the PHP SDK from our github repository to ensure that there are not other issues like this that you may run into.

 

Lastly, as this is a public forum that can be indexed by search engines, I did remove some sensitive details from your post so that the information would remain private.

 

If you experience any further issues, please reach back out to us and we will be happy to assist!

Elijah G.
API Support Engineer
Regular Participant

Hi there,

We are in need of below information:


1. How to implement Google Analytic in daily Campaigns
(we have a daily newsletter and some weekly emails and we need to integrate Google tracking to all sent email with their activity report)
We are currently creating daily campaigns by using V2 API.

2. how to get link from link id (in clicks report we are getting link id in response of tracking report and we need to display the actual link in our report).

3. how to change forward from email address?
Currently Constant Contact's forward email form is showing the admin email address that is assigned as a sender email address for all campaigns. When user click on forward email link from email he gets redirected to Constant Contact's forward email page.
We need to use email address of user as a sender email since user is forwarding the email.

4. How can I know who forward this email from forward email report?
Currently tracking API for forward email is returning contact id and admin email address as a sender email and we need the user who actually forward the email and to whom?


Thanks and regards,
Vijay

Hello vijay,

 

1. In order to implement Google Analytics in an email created through the API, you will need to apply the Google Analytics data to your links manually within your code that generates the email. For more information, you can view the FAQ article that we have on this subject: https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5991-using-google-analytics-with-an...

 

2. You can find all of the tracked URLs in an email along with the URL ID by making a GET request for the individual campaign details. You can find more information about this endpoint here: http://developer.constantcontact.com/docs/email-campaigns/email-campaign-resource.html

 

3. The forward from email address automatically updates to be from the recipient who clicks on the Forward to a Friend link.

 

4. At this time, we intentionally keep this information hidden for easier compliance with the CAN-SPAM act and to stay consistent with our permission-based mailing rules, which would conflict with things such as offering rewards to subscribers for forwarding an email. If you are interested in getting more information about this, I would advise contacting our general support team by phone at (866)-289-2101/(781)-472-8120 (intl.).''

 

Best Regards,

Elijah G.
API Support Engineer
Developer Portal

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

Visit Page