Home › Forums › Newsletter Plugin Support › WordPress Auto-Login Confirguration With Newsletter
- This topic has 4 replies, 3 voices, and was last updated 2 weeks, 1 day ago by Michael.
-
AuthorPosts
-
October 31, 2024 at 1:26 pm #334888supportParticipant
Here is my site address: https://noaiallowed.com
Visitors submit the only form on that page and then get forwarded to the next page /select-membership and right after they make their choice and submit, I have applied code to the functions.php file that automatically logs them into the site. Otherwise, it’s not as simple for them to register their shop and they must know to login first, in order to do so.
Unfortunately, when this code is applied and since they are automatically logged in, their email/name do not get automatically dropped into my linked Newsletter mailing list and none of the corresponding autoresponder emails get sent, so this is a problem.
Is there any code that I can add, or a plugin to make this work, understanding that I want all new registered users to be automatically logged in?
I couldn’t find an answer after searching for several hours on the internet about this.
Looking forward to hopefully uncovering a solution.
Thanks,
Rich.October 31, 2024 at 1:58 pm #334889StefanoKeymasterHi, but the registration of users (not subscribers) is managed using the WP registration standard functions? If so, using our wp users addon (or the wp user’s pro version since you have the autoresponder hence I imagine you have a valid license), the subscriber can be created during the registration.
November 3, 2024 at 3:22 am #334970supportParticipantI already have the WP Users Addon activated. However, I need to add code to the functions.php file that’s stored within the child theme folder, so that those who register by first submitting the form here https://noaiallowed.com, to then get forwarded to here https://noaiallowed.com/select-membership (to select their choice of membership) can be automatically logged in. Yet, due to making that automatic login function to happen, it causes the error where the new registered user’s email/name doesn’t automatically go in the Newsletter plugin list, nor do they receive any of the autoresponder emails.
Understanding this, how can we stop that from happening so new registered users can be automatically logged in and also be added the the Newsletter mailing list?
Your help with this is appreciated as I cannot find the answer through any of your tutorials…
November 3, 2024 at 4:27 am #334976supportParticipantP.S. This is the PHP code that I have applied to successfully auto login new users, but then I need to manually enter their email into the Newsletter Plugin mailing list in order for them to get added and receiving the autoresponder emails…
function auto_login_new_user( $user_id ) {
wp_set_current_user($user_id);
wp_set_auth_cookie($user_id, false, is_ssl()) ;
wp_redirect( ‘https://noaiallowed.com/watch-the-video-tutorial’ );
exit;
}
add_action( ‘user_register’, ‘auto_login_new_user’,10,1 );November 6, 2024 at 9:40 am #335154MichaelKeymasterHello,
Wp Users addon should add a new subscriber to Newsletter every time a new user gets registered, even if it gets redirected by your function. Is this not happening?
Michael
-
AuthorPosts
- You must be logged in to reply to this topic.