We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

How to insert unsubscribe link using CC api

SOLVED
Go to solution
JohnnyD37
Regular Participant

How to insert unsubscribe link using CC api

I am using Constant Contact api to create and send campaigns. Mail (html) and campaign are dynamically generated.

CC insert it’s footer with SafeUsubscribe link. This is all fine and ok, but ... I need to insert additional custom unsubscribe link in my html email.

 

I am using SignupLink tag described at: https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5252-create-a-custom-code-email-cam... but seems that this tag is not working with api created campaign.


Any help is highly appreciated. Thanks in advance.

1 ACCEPTED SOLUTION
DaveBerard
Moderator

The link described in that FAQ only works if you use the XHTML type Custom Code Campaign.  If you are using the HTML type Custom Code Campaign, the tag will go out as is and not function.  If you are using the XHTML Custom Code Campaign and still having a problem, it would greatly help if you can send us your username so we can look at your Custom Code Campaign and see what is going on.  You can email us at webservices@constantcontact.com to get us that information.

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

4 REPLIES 4
DaveBerard
Moderator

The link described in that FAQ only works if you use the XHTML type Custom Code Campaign.  If you are using the HTML type Custom Code Campaign, the tag will go out as is and not function.  If you are using the XHTML Custom Code Campaign and still having a problem, it would greatly help if you can send us your username so we can look at your Custom Code Campaign and see what is going on.  You can email us at webservices@constantcontact.com to get us that information.

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

JohnnyD37
Regular Participant

Thanks, I will try with the XHTML and post the results here.

Hello JohnnyD37,

 

I took a look at the emails in your account that you were testing and I see the problem you are running into. From what I can see you are wanting to use a custom URL that pulls in the contacts email address when they receive the email. You will need to use an XHTML format to accomplish any use of custom content and right now the email is in HTML.

 

With the way you have this setup the link will not work. This is because you are including the dynamic field within the link HTML and it won't render the link properly. This is due to the fact that we run the code through an XHTML validator before we parse in the information and having two opening brackets will make it fail.

 

The way to ensure this works correctly is to actually create a custom URL for each contact and upload all the HTML that is required for the link into the custom fields for the contacts. You would then simply reference those custom fields in the code.

 

For Example if I have the URL "Http://www.test.com/1111" and the "1111" is the dynamic content I would need to add "<a href="http://www.test.com/1111">Click here</a>" into the Contact Custom Fields. Each one of the Custom fields has a character limit of 50 characters so you do want to break the content up with that in mind.

 

For this example I would probably set it up as follows in the custom fields:
Custom Field 1: <a href="http://www.test.com/
Custom Field 2: 1111
Custom Field 3: ">Click here</a>
Note: To upload this successfully into Constant Contact you would have to create a spread sheet with all the columns labeled exactly as they are in our system so you can bypass the screen asking you to select a label.

 

Once this information is associated with the contact you would set it up in your code as follows:
<Property name="Subscriber.CustomText1"/><Property name="Subscriber.CustomText2"/><Property name="Subscriber.CustomText3"/>

 

You will not be able to see that this link is working until you test it as a live send but setting up the link this way should correct the issue you are running into.

 

Please let me know if you have any other questions about this and we will be happy to assist you.

 

Sincerely,
Erin B.
API Support

JohnnyD37
Regular Participant

CreateCampaign in XHTML mode => unsubscribe link is inserted.

Thanks

Developer Portal

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

Visit Page