Disable welcome e-mail after subscribing

SOLVED
Go to solution
Occasional Participant

Disable welcome e-mail after subscribing

Hi,


I'm working on a subscribe/opt out system for a client. Visitiors subscribe through a PHP form, which works fine. When a visitor subscribes however, an automatic e-mail message is sent to them from the Constant Contact website, saying they have subscribed. Is there any way to disable this message?


Thanks for the help!

1 ACCEPTED SOLUTION
Moderator

Hi Elango,


 


It looks like you found a small bug in our sample form.  When looking at the code path, I found that the OptInSource is being set correctly by you, but the XML builder does not reference it correctly.  There is a simple change required which I've listed below.  I will have the sample code updated to reflect this correction soon.  Thank you again for bringing this to our attention!


 


File - ContactComponent.cs


 


data.AppendFormat("<OptInSource>{0}</OptInSource>", optSourceNames);


 


Changed to


 


data.AppendFormat("<OptInSource>{0}</OptInSource>", optSourceNames);

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

9 REPLIES 9
Moderator

The only way to disable the Welcome email is to change the OptInSource node to ACTION_BY_CUSTOMER instead of ACTION_BY_CONTACT

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

I'll start using this methord from now on. Thnx for the reply !

Regular Participant

Hi Dave,


     I tried this solution when i use your API. Below is my code and its not working and I still get the welcome email. In this code i created a new list "All" and it carries ID as 3. When I run this code I am getting the welcome email. I am using these two dlls ConstantContactBO.dll & ConstantContactUtility.dll. Please do let me know what I am missing here.


Regards,


Elango


 string[] emailAddress = new string[] { "elango@ctsinternational.com" };


string nextChunkId;IList<Contact> list = Utility.SearchContactByEmail(AuthenticationData, emailAddress, out nextChunkId);if (list.Count == 0)Contact contact = new Contact();"elango@ctsinternational.com";"1000";"4255333932";"WA";ContactOptSource.ActionByCustomer;ContactOptInList contactoptlist = new ContactOptInList();ContactOptSource.ActionByCustomer;new ContactList("3");Utility.CreateNewContact(AuthenticationData, contact);


 


 


 


 


{


 


contact.EmailAddress =


contact.Id =


contact.HomePhone =


contact.City =


contact.OptInSource =


 


contactoptlist.OptInSource =


contactoptlist.ContactList =


 


contact.ContactLists.Add(contactoptlist);


 


}

Moderator

Hi Elango,


 


It looks like you found a small bug in our sample form.  When looking at the code path, I found that the OptInSource is being set correctly by you, but the XML builder does not reference it correctly.  There is a simple change required which I've listed below.  I will have the sample code updated to reflect this correction soon.  Thank you again for bringing this to our attention!


 


File - ContactComponent.cs


 


data.AppendFormat("<OptInSource>{0}</OptInSource>", optSourceNames);


 


Changed to


 


data.AppendFormat("<OptInSource>{0}</OptInSource>", optSourceNames);

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

This solution does not work........ After changing that you get a request 400 error

Hey Rachel,

 

The solution should work, however this post is rather old.  Can you please post the XML that it is trying to pass when you get that 400 error?

 

Ryan Davis
Quality Engineer

The solution content was corrupted when we moved from our old forum to the current one.  The correct code for the solution is to change this line:

 

data.AppendFormat(

"<OptInSource>{0}</OptInSource>", optSourceNames[ContactOptSource.ActionByContact]);

 

to this:

 

data.AppendFormat(

"<OptInSource>{0}</OptInSource>", optSourceNames[contact.OptInSource]);

 

This will correctly use the OptInSource you set in the Contact.  This change is going to be reflected completely in v10 of the C# wrapper code which will be uploaded to SourceForge later in the day.  That version will also contain a fix for handling STOCK campaign updates.

 

Sorry for the confusion on this.

Dave Berard
Senior Product Manager, Constant Contact

Do you place this code in the formstack autoresponder code since thats who you use for forms?

Hi,

 

Formstack wrote the code for their integration, but if they did use the .NET wrapper referenced here as a starting point, it was fixed with this change quite a while ago, so they would have the correct version.  They did write the code to send the welcome email, and there isn't a way to modify that when using their integration.  Sorry for the limitation.

 

Best Regards,

Shannon W.

API Support Specialist

Developer Portal

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

Visit Page