Home › Forums › Newsletter Plugin Support › Unsubscribe help/defaults
- This topic has 14 replies, 6 voices, and was last updated 5 years, 10 months ago by Rumyan Tsekov.
-
AuthorPosts
-
November 23, 2018 at 9:32 pm #134692AnonymousInactive
Hello!
I am completely new to this – and am having great difficulty setting up my unsubscribe service.
Without having to reinstall the plugin – could you send me the default settings, and perhaps a step by step guide on how I set this up?
Thank you so much!
Michael
November 24, 2018 at 6:20 pm #134815StefanoKeymasterHi, there is not an sunsubscription to setup, when you send emails with Newsletter an unsubscription link is usually added, so the user can subscribe.
Stefano.
January 1, 2019 at 7:01 pm #143443Rumyan TsekovParticipantHi, Happy New Year!
I believe, in this year you will implement unsubscribe shortcode and/or link to implement on any page we need?
The second wish is a hook, so that when some plugin deletes the user profile, because of the GDPR this will trigger user removal from the lists.
Happy holidays!
January 2, 2019 at 10:10 am #143562Rumyan TsekovParticipantIn the spirit of the New Year’s miracles, I was able to find a temporary work-around and I am going to share it with others, if that is not a problem!
In my case, I’m customizing woocommerce’s file dashboard.php by using a copy of the original file into my child theme’s folder (common practice to override anything in wordpress). My file is located at: wp-content/themes/oceanwp-child-theme-master/woocommerce/myaccount/dashboard.php (because I use the oceanwp theme).
In this file, which is already part of the code, I have added the following code (below), which will create two buttons Subscribe and Unsubscribe in HTML.
It is already available inside The Newsletter Plugin itself. Anyone can find it in -> List Building -> Subscription Form Fields, Buttons, Labels -> CodeWhat I needed was the ability to pre-populate current user’s email in the text field, so I got the information from the wp database.
Next, I extracted the unsubscribe link parameters from the database, by inspecting the unsubscribe link that every user receives in their email, generated the unsubscribe link in a string parameter and added it to the buttons.
You can nest this code within any hooked .php file with a little bit of testing, so I hope someone may find it useful.
<?php
global $wpdb;$your_website_s_url = get_bloginfo(‘wpurl’);
$current_user = wp_get_current_user();
$current_user_s_email = $current_user->user_email;$tableName = $wpdb->prefix . ‘newsletter’;
$the_newsletter_s_array = $wpdb->get_results( “SELECT * FROM {$tableName} WHERE email = ‘$current_user_s_email'”);foreach ( $the_newsletter_s_array as $subscriber_s_email ){
$unsubscribe_link = $your_website_s_url . “/?na=uc&nk=” . $subscriber_s_email->id . “-” . $subscriber_s_email->token;
}
$subscribe_link = $your_website_s_url . “?na=s”;?>
<div class=”tnp tnp-subscription”>
<form method=”post” action=”<?php echo $subscribe_link ?>” onsubmit=”return newsletter_check(this)”><input type=”hidden” name=”nlang” value=””>
<div class=”tnp-field tnp-field-email”><label>Email</label><input class=”tnp-email” type=”email” name=”ne” value=”<?php echo $current_user_s_email ?>” required></div>
<div class=”tnp-field tnp-field-privacy”><label><input type=”checkbox” name=”ny” required class=”tnp-privacy”> By continuing, you accept the privacy policy</label></div>
<div class=”tnp-field tnp-field-button”><input class=”tnp-submit” type=”submit” value=”Subscribe”>
</div>
</form>
</div><div class=”tnp tnp-subscription”>
<form method=”post” action=”<?php echo $unsubscribe_link ?>” onsubmit=”return newsletter_check(this)”>
<div class=”tnp-field tnp-field-button”><input class=”tnp-submit” type=”submit” value=”Unsubscribe”>
</div>
</form>
</div>Please, try not to break your site 🙂 test it in a staging environment 1st!
Happy New Year!
January 2, 2019 at 12:39 pm #143591Little CousetteParticipantThnak you for the ersponse, but when I click to the unsusbcribe link, it gives me a 404 error.. what is wrong please?
January 2, 2019 at 12:41 pm #143593Little CousetteParticipantThank you for the response, but when I click to the unsusbcribe link automatically added at the bottom of my emails, , it gives me a 404 error: page not found.. what is wrong please?
Please help me !
Best regards,
ChristelleJanuary 2, 2019 at 1:52 pm #143608Rumyan TsekovParticipantHey 🙂 Happy New Year!
I am not a developer and this solution is my way of fixing things. I am customer as you, sharing my findings with others. In my case this code is inserted into the dashboard.php of my child theme and it works. Where are you trying to implement it?
EDIT: one more thing to mention: when copying this code, HTML formatting replaces all ” an ‘ with wrong ones. Make sure to find-replace in Notepad for example all those 1st
January 2, 2019 at 3:32 pm #143641Rumyan TsekovParticipantand just found out that if you need, can define to which list the subscriber should belong by adding: list=”Name_of_the_list”
at this row: <div class=”tnp-field tnp-field-button”><input class=”tnp-submit” type=”submit” value=”Subscribe” list=”Name_of_the_list”>
January 3, 2019 at 8:49 am #143799Little CousetteParticipantThank you so much for your response Rumyan.. I am so sossory, but i did not understand how to do that in my dashboard …:-(
Howver, in fact, I understand the problem: it does not work when I click in the link in my newsletter directly, but it work for susbcribers (I made some test with phantom emails..)
Happy new year !
ChrisJanuary 3, 2019 at 1:31 pm #143847Rumyan TsekovParticipantYes. This work-around is for browsers. For emails, there are already shortcodes in curly brackets – well documented.
Cheers 🙂
January 5, 2019 at 5:44 am #144307tdcpepsiParticipantWhere is the “UNSUBSCRIBE PAGE” or shortcode, so that my subscribers can unsubscribe from my mailing list????
January 9, 2019 at 10:45 am #145174Scambia RicetteParticipantDear All,
I’ve the same problem, I test it clicking unsubscribe link in my profile page and opena a new page (with final perma: %7Bunsubscription_confirm_url) with: Error 404!
Have I to add a shortcode to the profile page?
Thanks in advance for a reply
Regards
AndreaJanuary 9, 2019 at 11:00 am #145181Rumyan TsekovParticipantHey! Please, try opening Incognito window in your browser. Does it work there?
January 9, 2019 at 11:27 am #145189Scambia RicetteParticipantDear Rumyan,
no it doesn’t work in chrome incognito mode too.
🙁January 9, 2019 at 11:32 am #145194Rumyan TsekovParticipantI can only guess, that your theme options set buttons to open in new window and the variables are lost?
-
AuthorPosts
- You must be logged in to reply to this topic.