Between 8:00 - 9:00 am ET on 10/25 we need to take our site down to make updates. We recommend logging out before 8:00am ET and not using your account during this time. Thank you for your patience while we make these important updates.

Welcome eMails tailored to specific lists

Member

Welcome eMails tailored to specific lists

Can someone please point me in the right direction for documentaion that deals with creating a custom welcome email for a specific email list via the API (php). I have been told by support that the documentation is here somewhere but it is certainly not easy to find if it is.

 

Thanks!

24 REPLIES 24
Employee

Hello,

 

I apologize for the confusion.  While technically it would be possible to create something in our API that sent an email to an email address when they signed up to the account, based on the list that they signed up to.  Our system is not really designed to do this.  In the methods that are set up to do automatic emails, the welcome email and autoresponders, they can only be set up per account.  So that you can have one autoresponder going out to a set of lists, but you cannot have a second autoresponder on a different set.  The welcome email also can only go out to people who are signed up "by contact", and does not differ between lists.

 

The only work around would be to create a complex system where as a contact signs up, it is assigned to an additional, but empty list, and then an email is created and scheduled for that list.  Once the contact gets the email, he would be removed from the list and it would have to be repeated.  While this is possible, it is not really a great way to do it, and again, our system is not really designed to be used in that way.

 

If you have any questions please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact

There are two ways I have been able to this.  The first is to use multiple constant contact accounts and have multiple API's on your website sending to different accounts. Just make different welcome emails on each account.

 

The other option if you are using WordPress is to use Katz Web Services Constant Contact API along with Contact Form 7. Katz put out an additional plugin called "Contact Form 7 & Constant Contact" that you can use to make seperate forms on your WordPress site and assign them to specific list. There is an Email Auto responder functionality in Contact Form 7, so you can tailor specific welcome letters. Just remove the welcome letter from Constant Contact and you are all good.

 

Hope that helps.

 

 

Great ideas, and I know the Katz Contact Form 7/Constant Contact integration works very well.

 

Mark Coleman
Support Engineer

I know this thread is old, but it seems to be the most current. I'm using gravity forms + Katz Web Services CC+GF plugin and want to send welcome emails tailored to multiple lists. I understand the logic of LauraD238's approach and the 2nd option would work great for me except that I can't figure out how to remove the welcome letter from CC. I've found various references around the CC forms that say it isn't possible or that it can be done by changing all PHP references from ACTION_BY_CONTACT to ACTION_BY_CUSTOMER, but that didn't work for me.

Hi,

 

You're correct, the solution should be to change your optInSource to action by customer instead of action by contact.  I just tested and when I set the opt in source to action by customer, the welcome email isn't set out (as it shouldn't be).  Can I see the code you're using to add contacts (with your credentials removed)?

 

Best Regards,

Shannon W.

API Support Specialist

Hi Shannon,

 

Thanks for the help!

 

I'm using the Katz plugin "Gravity Forms Constant Contact Add-on" found here: http://wordpress.org/extend/plugins/gravity-forms-constant-contact/

 

There are 3 instances of ACTION_BY_CONTACT in constantcontact.php.

line 534

line 1150

and line 1151

I tried changing each to ACTION_BY_CUSTOMER.

Still got confirmation emails.

 

There's also this reference in the plugin's readme.txt:

= How do I prevent opt-in confirmation emails? =

To disable "Confirmed Opt-in", add this code to your theme's `functions.php` file:

`
add_filter('gravity_forms_constant_contact_action_by', 'return_action_by_customer');
function return_action_by_customer() { return 'ACTION_BY_CUSTOMER'; }
`

 I restored constantcontact.php to its original state and added the code to functions.php, but still get the confirmation email.

 

Nathan

Hi Nathan,

 

Do you have confirmed opt-in on in your account? 

 

You can check by logging into your account, going to "My Settings" at the top right, and then look on the righthand side to see whether confirmed opt-in is ON or OFF.

 

Best Regards,

Shannon W.

API Support Specialist

Confirmed Opt in is currently set to off.

Hi Nathan,

 

I downloaded the plugin you're using from Wordpress/Katz, and see that the opt in source is set on line 25 of cc_class.php (inside their api folder in the download).  Can you verify that this is set to ACTION_BY_CUSTOMER to suppress the welcome email?  It looks like it is set to action by contact by default.

 

Best Regards,

Shannon W.

API Support Specialist

Regular Participant

Hello Guys,

 

I recently started using your API. I downloaded the .net wrapper from github. Set it up and ran my first test in less than 5 minutes. Awesome.

 

However, i was not supposed to get a welcome email and i did. My Setting are set to OFF, OptIn by Customer, everything is exactly how you are suggesting.

 

Any help on this?

 

EDIT... I set the ActionByCustomer in the OptinList, not the customer. I guess that's what failed? I am retrying. I will keep you posted.

 

EDIT 2: Nope. I keep on getting Welcome emails. I have set everything to Customer and still popping in.

 

EDIT 3: In constant contact, it shows Added By Contact. Shouldn't it say Customer?

Hi,

 

Yes, it does sound like you are adding with an optinsource of action by contact (when you know you want action by customer).  The line that you should have to set the opt in source should look something like this with the .NET wrapper.

 

contact.OptInSource = ContactOptSource.ActionByCustomer;

 

If you still have trouble, could you post a code snippet of how you're adding a contact?

 

Best Regards,

Shannon W.

API Support Specialist

 

P.S.  I'm gald you found the wrapper to be easy to set up!

Regular Participant

Hello Shannon.

 

The Wrapper is a breeze. Very well done.

 

Here is my code

 

var contact = new Contact("someone@gmail.com", "Jose", "Fernandez");

            var contactOptIn = new ContactOptInList();
            contactOptIn.OptInSource = ContactOptSource.ActionByCustomer;
            contactOptIn.OptInTime = DateTime.Now;
            contactOptIn.ContactList = result.Find(cl => cl.Name.Contains("Wellness")); //result is a lookup of my contactlists

            contact.OptInSource = ContactOptSource.ActionByCustomer;

            contact.ContactLists.Add(contactOptIn);

            var newContact = ConstantContact.AddNewContact(contact);

Hi,

 

I had to make 2 edits that I think might have altered your results.  I added the contact to my list 1 instead of doing the list search.  I'm including that just in case it makes a difference.  The biggest difference was in my last line of code--try swapping it out for your previous last line.  If that doesn't alter your results, swap out the code mapping the list as a troubleshooting step.

 

I did use one of my own email addresses with this code to make sure I didn't receive a welcome email ( I did not).

 

            var contact = new Contact("myemail@example.com", "Jose", "Fernandez");

            var contactOptIn = new ContactOptInList();
            contactOptIn.OptInSource = ContactOptSource.ActionByCustomer;
            contactOptIn.OptInTime = DateTime.Now;
            //contactOptIn.ContactList = result.Find(cl => cl.Name.Contains("Wellness")); 
//result is a lookup of my contactlists contactOptIn.ContactList = new ContactList("1"); contact.OptInSource = ContactOptSource.ActionByCustomer; contact.ContactLists.Add(contactOptIn); Utility.CreateNewContact(authdata, contact);

 Best Regards,

Shannon W.

API Support Specialist

Regular Participant

:)

Well, now i am puzzled. It works for you, but it doesn't for me :(

 

Your changes really shouldn't affect anything. When i add my new contact, it actually goes to the right contactlist. That seems to be perfect.

 

your last line of code is exactly what i am doing in my own cc class. I am calling that exact method in the utility.

 

Not a clue what can be happening here. I am thinking to use fiddler and intercept whatever my application is sending to your API and see what's going on.

 

 

Using Fiddler to see what is being sent to us is a good idea.  If you haven't already, you could put a break point in your code right before the Utility class is called to see what the contact object looks like before sending it to us.  Could it be a simple problem like calling the wrong project (setting a different project to be the startup project)?

 

Best Regards,

Shannon W.

API Support Specialist

Regular Participant

Hello Shannon,

 

I added the instance to an Watch and it looks perfect. I guess at this point there is no need to go ahead with the fiddler since the object seems to have its properties set correctly.

 

I am really eager to solve this. At this point I don't know what to do. I feel i am doing everything right but still get the undesired results

 

I don't know what to do...

Hi Jose,

 

I'm sorry for the frustration.  Please use Fiddler or check your server logs to see the XML you're sending us.  Aside from not running the right project or having code that overrides the code we've exchanged previously, I can't think of a reason you should get a welcome email when setting the optinsource to action by customer.  I can't seem to reproduce any issues on our side that would send out a welcome email erroneously.

 

Please post your XML (with your username/email address removed) so that we can gain some insight into what's happening.

 

Best Regards,

Shannon W.

API Support Specialist

Regular Participant

Hello Shannon,

 

Yes, Fiddler shows my action by Contact... :(

 

So, at this point, all i can think of is that my Object is being modified by the API before sending it thru the wire. Correct?

 

i am using ContantContactUtility.dll Runtime Version v2.0.50727. Same for ConstantContactBO.

 

<entry xmlns="http://www.w3.org/2005/Atom"><title type="text"></title><updated>2008-07-23T14:21:06.407Z</updated><author></author><id>data&colon;,none</id><summary type="text">Contact</summary><content type="application/vnd.ctct+xml"><Contact xmlns="http://ws.constantcontact.com/ns/1.0/"><EmailAddress>email@somewhere.com</EmailAddress><FirstName>Jose</FirstName><MiddleName></MiddleName><LastName>Fernandez</LastName><HomePhone></HomePhone><Addr1></Addr1><Addr2></Addr2><Addr3></Addr3><City></City><StateCode></StateCode><StateName></StateName><PostalCode></PostalCode><SubPostalCode></SubPostalCode><CountryCode></CountryCode><CompanyName></CompanyName><JobTitle></JobTitle><WorkPhone></WorkPhone><EmailType>HTML</EmailType><OptInSource>ACTION_BY_CONTACT</OptInSource><Note></Note><CustomField1></CustomField1><CustomField2></CustomField2><CustomField3></CustomField3><CustomField4></CustomField4><CustomField5></CustomField5><CustomField6></CustomField6><CustomField7></CustomField7><CustomField8></CustomField8><CustomField9></CustomField9><CustomField10></CustomField10><CustomField11></CustomField11><CustomField12></CustomField12><CustomField13></CustomField13><CustomField14></CustomField14><CustomField15></CustomField15><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/{erasedByMe}/lists/3"/></ContactLists></Contact></content></entry>

 

Hi Jose,

 

You are correct; something is changing your data before you send it over.  Quite honestly, when something like this has happened to me, it's because I've had an alternate project set as a startup project in Visual Studio that had different code in it, and I was accidentally running the wrong project.

 

By default, the .NET package should contain Form1.cs, which is normally used to house your code.  If you download the .NET package and paste just the code we've exchanged into Form1.cs, that should wipe out any code that was inadvertently added.

 

Best Regards,

Shannon W.

API Support Specialist

Regular Participant

OK, So...


This is what i did now (and seems to be working.) I previously had a reference to the DLL in your wrapper (downloaded from GitHub).

 

By the way, all i had was a simple empty mvc3 project with a Home controller and an Index action. All my code was in that action. very simple and straight forward.

 

Now, I deleted my references and added manually the two projects from your solutions CCBO and CCUtility. I went inside your code all the way down to the webrequest keeping an eye on the data (even after converted to byte array), then got trasmited to your api, and seems to be perfect. I didn't get an email and it's showing Added By Owner in my Contacts (inside Constant Contact website).

 

It's working. BUT i still don't know what could've happened. Maybe you should try and see why this is happening. You can sort of follow my steps and see if you have the same results.

 

1. Create a solution with a simple MVC3 application project.

2. Download your wrapper from GitHub and unzip it to a folder

3. Add a reference in the MVC project to your DLLs (output folder / Release)

4. Run your MVC app

 

You should get the unexpected result. ActionByContact.

 

5. Delete your references.

6. Add those two projects in Development folder (from your download) to your MVC solution.

7. Run it.

Should be good to go.

 

My only concern is, since i don't know the true cause of this failure, will this work properly from now on?

 

Developer Portal

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

Visit Page