Support » Plugin: Contact Form 7 Newsletter » Plugin Doesn't Work

Viewing 9 replies - 1 through 9 (of 9 total)
  • I’m having the exact same issue. WP 4.3.1

    I had this issue and spent some time back-tracking the issues I was experiencing. For me, there was two –

    The first problem I found was with the Tag Generator. It generates the shortcode as such:

    [ctct ctct-1234 type:single 'List Name::#1212121212' subscribe_type_radio:single]

    It needs to be reordered as such:

    [ctct ctct-1234 type:single subscribe_type_radio:single 'List Name::#1212121212']

    Why does this make a difference? It shouldn’t. Best I can tell is the regex in contact-form-7/includes/shortcodes.php function shortcode_parse_atts breaks with the enclosing quotes and ::# format.

    The second problem I encountered is that this plugin requires the ctct- name prefix.

    [ctct ctct-1234 ...] // works
    [ctct ctct-my_custom_field ...] // works
    [ctct my_custom_field ...] // doesn't work

    This check is found in contact-form-7-newsletter/cf7-constantcontact.php, function get_submitted_lists

    Another thing that bugged me is that you can only have one ctct shortcode per form. I wanted a newsletter signup that had an option to also sign up for a secondary mailer. One hidden field and one checkbox – this plugin only checks the first ctct shortcode and ignores the rest. You can add multiple checkboxes or select options, but I wanted to force one and make one optional.

    So time for a minor plugin modification. In contact-form-7-newsletter/cf7-constantcontact.php, function get_submitted_lists make the following modification:

    if( false !== strpos( $key, 'ctct-' ) ) {
    	//$lists = $data;
    	//break;
    	$lists = array_merge($lists, $data);
    }

    Perfect, now it loads up all of my lists! New and existing users.

    As an addendum to my last; best to add a quick error check in when merging the arrays.

    if( false !== strpos( $key, 'ctct-' ) ) {
    	//$lists = $data;
    	//break;
    	if (is_array($data) && !empty($data))
    		$lists = array_merge($lists, $data);
    }

    dacrosby,

    I tried reordering my shortcode after generating and inserting it into the form as you suggested but entries are not being sent to Constant Contact:

    [ctct ctct-1234 type:single 'List Name::#1212121212' subscribe_type_radio:single]

    to

    [ctct ctct-1234 type:single subscribe_type_radio:single 'List Name::#1212121212' ]

    Additionally, on the Mail tab within a Contact Form 7 form, I tried changing references to [ctct-123] to [ctct ctct-123] but it is still not interpolated so the sent email will have [ctct-123] or [ctct ctct-123] included in the email.

    Any other ideas?

    Quick update: I added the code change as dacrosby suggested to wp-content/plugins/contact-form-7-newsletter/cf7-constantcontact.php

    if( false !== strpos( $key, 'ctct-' ) ) {
    	//$lists = $data;
    	//break;
    	if (is_array($data) && !empty($data))
    		$lists = array_merge($lists, $data);
    }

    And now, any shortcodes entered into the subject, body, etc. ie [ctct-123] are changed to the numeric ID of the Constant Contact list within the sent email, however, entries are still not being delivered to Constant Contact.

    Plugin Author Zack Katz

    (@katzwebdesign)

    @dacrosby You’re absolutely right – CF7 changed the order of the shortcode. Very frustrating! I’ve fixed this issue, and included the lists merge code. Thank you for your help.

    Hi Zack

    Thanks for the fix.

    Are you getting sufficient support from Constant Contact? If you need help I have a number of senior contacts there.

    Kind regards…Peter

    I’m using the latest version of cf7 and wp but it doesnt seem to send the entries to constant contact still, I installed the latest cf7newsletter but with no luck. Reading this thread it appears to be fixed but is this a fix I have to apply manually? If so what do I need to do to get it working?

    Thanks a lot!
    Tim

    @dacrosby, thank you so very much. I spent an entire day trying to suss this out! I reordered the tags and added

    if( false !== strpos( $key, 'ctct-' ) ) {
    	//$lists = $data;
    	//break;
    	if (is_array($data) && !empty($data))
    		$lists = array_merge($lists, $data);
    }

    as you suggested, and all is well now. Thanks again.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Plugin Doesn't Work’ is closed to new replies.