cancel
Showing results for 
Search instead for 
Did you mean: 

Welcome eMails tailored to specific lists

Occasional Participant

Re: Welcome eMails tailored to specific lists

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?

CTCT Employee

Re: Welcome eMails tailored to specific lists

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!

Occasional Participant

Re: Welcome eMails tailored to specific lists

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);

CTCT Employee

Re: Welcome eMails tailored to specific lists

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

Occasional Participant

Re: Welcome eMails tailored to specific lists

:)

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.

 

 

Highlighted
CTCT Employee

Re: Welcome eMails tailored to specific lists

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

Occasional Participant

Re: Welcome eMails tailored to specific lists

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...

CTCT Employee

Re: Welcome eMails tailored to specific lists

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

Occasional Participant

Re: Welcome eMails tailored to specific lists

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>

 

CTCT Employee

Re: Welcome eMails tailored to specific lists

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