cancel
Showing results for 
Search instead for 
Did you mean: 

Functionality of my WordPress CC form

Functionality of my WordPress CC form

Hi all! I've created a customized form for my WordPress site by putting the embed form (with customizations) into a WordPress template page. But I'm not quite there yet: the form doesn't direct the user to any kind of results page after then enter their info and submit.  What I'd prefer is a way to show them a message that says "Watch your email for a confirmation link"... or if they're already subscribed, one that says "This email address is already subsribed to the list". That sort of thing. I presumed this would be easy, but I can't for the life of me figure out how to achieve it with the info provided on the CC site. 

 

I did find this info here on the Developer area:

 

http://developer.constantcontact.com/docs/signup-forms-tools/signup-form-code.html

 

But that's WAY over my head and doesn't address what I hoped/assumed would be a simple thing. I hoped it would simply be a matter of adding a parameter to the form.

 

I haven't tried the CC plugin since my solution is so close already and so customized via templates. Is that the way to go, or is there another way to achieve what I'm looking for?

 

Thanks!
adam

3 REPLIES 3
Honored Contributor

Re: Functionality of my WordPress CC form

Hello,

 

What you're looking to accomplish should be pretty simple, as long as your form is still using the Javascript that was included with the embeddable code. Within the default embed code, there is the following HTML:

<span id="success_message" style="display:none;">
           <div style="text-align:center;">Thanks for signing up!</div>
</span>

This specific message is hidden by default and is switched to be shown by the Javascript when the form is successfully submitted. It is worth noting that a new contact and an existing contact are both considered to be a success and would receive the same message. You can also see in the embed code some error messages that are displayed for the different reasons that the form could fail. Here's what that code looks like:

<script type='text/javascript'>
   var localizedErrMap = {};
   localizedErrMap['required'] = 		'This field is required.';
   localizedErrMap['ca'] = 			'An unexpected error occurred while attempting to send email.';
   localizedErrMap['email'] = 			'Please enter your email address in name@email.com format.';
   localizedErrMap['birthday'] = 		'Please enter birthday in MM/DD format.';
   localizedErrMap['anniversary'] = 	'Please enter anniversary in MM/DD/YYYY format.';
   localizedErrMap['custom_date'] = 	'Please enter this date in MM/DD/YYYY format.';
   localizedErrMap['list'] = 			'Please select at least one email list.';
   localizedErrMap['generic'] = 		'This field is invalid.';
   localizedErrMap['shared'] = 		'Sorry, we could not complete your sign-up. Please contact us to resolve this.';
   localizedErrMap['state_mismatch'] = 'Mismatched State/Province and Country.';
	localizedErrMap['state_province'] = 'Select a state/province';
   localizedErrMap['selectcountry'] = 	'Select a country';
   var postURL = 'https://visitor2.constantcontact.com/api/signup';
</script>

You could customize the messages here to impact what your users see when there is an error submitting the form.

 

If you have any questions or problems, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer

Re: Functionality of my WordPress CC form

Thanks for this, Elijah! 

 

I guess I did maintain all the appropriate code, as my custom form does reveal a message after clicking "Subscribe". Yay! So I'm mostly there - I just have one followup question related to Confirmed Opt-In, which I have now enabled for the list in question. 

 

Since I have COI enabled, should I simply edit that message, normally hidden by CSS, to say something like "Thanks for signing up - watch for an email which will allow you to confirm your subscription."  ?

 

I assume that if they're already subscribed, they won't receive that confirmation email again - but I'm guessing that there isn't any way to customize the message to account for that? I can live with that, but it's a little inelegant so thought I'd ask...

 

Final question: I'm now using your WordPress plugin, but don't see any place where I can customize the messages there. They aren't actually subscribed until they click the email confirmation link, but when I test it, it still says "Success, you have been subscribed." right away on the web page - which isn't actually correct. How do I handle DOI with the plugin?

 

Thanks!
Adam

Honored Contributor

Re: Functionality of my WordPress CC form

Hi Adam,

 

Since you are using COI, I think it would definitely be a good idea to have some kind of mention. However, you are absolutely correct that the embeddable form isn't smart enough to be able to differentiate.

 

Regarding the plugin, I believe that the only way you could customize the messaging would be to find that message in the source code for the plugin and modify it. Since this plugin is built and maintained by one of our partners, I wouldn't be able to tell you precisely where that would have to be done without digging into the code myself. However, if you're pretty comfortable with PHP, it should be possible to use a search tool to find occurrences of the exact error message in the plugin source code and change it.

 

If you have any questions, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer