WordPress.org

Ready to get started?Download WordPress

Forums

Newsletter
[resolved] Placing the single opt-in checkbox (11 posts)

  1. dhunink
    Member
    Posted 1 year ago #

    Hi There,

    I'm using Newsletter together with Theme-my-login and have modified the registration form also via functions.php.
    When I choose 'Yes, show the option' in the 'Automatically subscribe WordPress users' settings, the checkbox isn't placed where I want it to be.

    When I manually place the same checkbox, new registred users that checked the checkbox arent subscribed.

    Is there like a callback or something I should use to subscribe users when they checked it?
    Or which function should I call on what moment in the registration process to send a user_id to Newsletter and let it subscribe the user?

    Thanks!

    http://wordpress.org/extend/plugins/newsletter/

  2. Stefano Lissa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, the plugin needs a modification to manage your case. Actually it accepts a subscription during registration only in combination with the automatic adding of the check box.

    I'll put this new behavior on my list, probably I'll be able to code and release it in few days.

    Stefano.

  3. dhunink
    Member
    Posted 1 year ago #

    Hi Stefano. Thanks for replying on such short notice. If it would be possible to release an update which brings this possibility that would be real great and predicated!

    If you need more info about my configuration/setup to get a better idea of the circumstances in which such an option would be needed if would be happy to help off course.

    By the way, I really like your plugin. It's way better then a lot of the alternatives out there. Wonderfull!

  4. dhunink
    Member
    Posted 1 year ago #

    Hi Stefano,

    In addition to my previous question, a similair one. I would not only manually want to add a 'subscribe' button to my own Registraton form, I also would like to display a checkbox on the default profile page so users can manage there subscription not only by using a link from a newsletter but also by just checking/unchecking the subscription checkbox in there profile page.

    I can do that by using a custom button and then do the following. But I wonder if you feel like doing it another way.

    add_action( 'profile_update' , 'update_newsletter_subscription' );
    function update_newsletter_subscription(){
    //manually run SQL query to adjust the setting of wp_newsletter table
    }

  5. dhunink
    Member
    Posted 1 year ago #

    Hi Steffano,

    thanks for the latest update. Manually coding the opt-in button works like a charm!

    However, users now receive double e-mails. One saying the've registered a account and one saying the've registered to the newsletter. Wouldn't it be a good idea to provide an option to NOT send the welcome message (or not send it when registered through wp-registration).

  6. dhunink
    Member
    Posted 1 year ago #

    Hi Steffano,

    sorry for spamming. But I think I might have found a bug.
    When a user is added as a subscriber via the wordpress registration field, the wp_user_id in the DB is left empty.

  7. tedzz
    Member
    Posted 1 year ago #

    Hi dhunink,

    May I ask how did you manage to get opt-in button into your theme?

    Thank you

  8. dhunink
    Member
    Posted 1 year ago #

    Hi Tedzz,

    Sure. It's possible after the last plugin update.
    In the register form, add this line:

    <p>
        	<input value="1" name="newsletter" type="checkbox" checked="checked">&nbsp;Recieve updates
        </p>

    The plugin will handle the rest

  9. tedzz
    Member
    Posted 1 year ago #

    Thank you for help, dhunink!

    It works great, but it would be even better if I was able to grab a name from a form and add it to newsletter.

    I'm using buddypress theme for register so it's php code for "Name" is:

    <input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />

    html source:

    <label for="field_1">Name (required)</label>
    																		<input type="text" name="field_1" id="field_1" value="" />

    And html for newsletter:

    <th>Name</th>
    	<td><input class="newsletter-firstname" type="text" name="nn" size="30"></td>

    Any help with parsing these would be appreciated.

    Thank you

  10. dhunink
    Member
    Posted 1 year ago #

    Hi Tedzz,

    that's a thing the plugin seems not to support on the moment, since the user is registered based on his wordpress ID. And since there seems to be a little bug that doesnt drop the wp_user_id in the newsletter db_table when user registred through the wordpress form, you can't receive it's name by ID. But you actually can by searching in the e-mail row. So a workaround could be to add some stuff in your functions.php were you update the newsletter table with data from the wp_users table, after the user is registred.

  11. Stefano Lissa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, actually the subscription (even if there is a wp_user_id column) is treated as a normal subscription with no real relation with wp user. The plugin must be better integrated with wp user registration so the email used should be always taken from the wp_users table. But actually the newsletter subscriber table has a constrain on email column to be an unique value so there is a but more of work to avoid conflict.

    Probably the best way is to put into the email columns inside the newsletter subscriber table the actual wp user id so it will be a direct a secure link to the user profile.

    Then, while sending, the email address must be loaded from the wp_users.

    Hence there is a bit of work to create a perfect integration.

    Stefano.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic