Disable subscription: Solution is here

Solutions for other advanced phplisters

Re: Disable subscription: Solution is here

Postby webgyrl » 5:23pm, Sat 08 Nov, 2008

bangonthedrum wrote:yicktan found the solution. I am reposting it here for everyone's convenience:


-----------------
subscribelib2.php

Search for
values("%s",now(),"%s",0,%d,%d,"%s")'

Change to
values("%s",now(),"%s",1,%d,%d,"%s")'
-----------------

Now all you have to do is change the "confirm your subscription" messages a user receives to reflect a confirmation. I have listed them all below:


PHP Admin

Subscribe Pages:
Thank you page
Message they receive when they confirm their subscription

Configure:
Subject of the message users receive when they subscribe
Message users receive when they subscribe
Subject of the message users receive after confirming their email address
Message users receive after confirming their email address

File
texts/english.inc
$strEmailConfirmation = 'Your email has been added to our system. You will be e-mailed shortly with a request to confirm your membership. Please make sure to click the link in that message to confirm your subscription.';


OK I have used this and I do get the user auto confirmed, however the "Request for confirmation" letter is still being sent out.

I went into "phplist - configure phplist" and tried to change the email from:
Almost welcome to our newsletter(s) ...

Someone, hopefully you, has subscribed your email address to the following newsletters:


* Omega Crom Mailing List

If this is correct, please click the following link to confirm your subscription.
Without this confirmation, you will not receive any newsletters.

[confirmation link is here]

If this is not correct, you do not need to do anything, simply delete this message.

Thank you


TO

Welcome to the **** ****** Mailing List...

Someone, hopefully you, has subscribed your email address to the following newsletters:

[LISTS]

Thank you for supporting **** *****!



What's strange is that even though I have cleared cache and cookies and restarted Firefox, when I do the test signup the old email is still coming in asking to confirm. I don't mind the email, but I want to change it to a WELCOME email instead of a CONFIRMATION EMAIL.

Also, I need to change the text that shows up right after someone has signed up. It currently says:
Thank you for subscribing to our newsletters.
Your email has been added to our system. You will be e-mailed shortly with a request to confirm your membership. Please make sure to click the link in that message to confirm your subscription.


Where do I change this? I have already looked in the I have looked in the english.inc file and can't find this in that file. I want to change this text.

Any assistance would be greatly appreciated.


EDIT TO SAY I FIXED IT

OK all the info that I needed to change was in the Subscribe pages for my particuar list. So go there to change all the messages and bingo!
webgyrl
PL Nut
 
Posts: 17
Joined: 4:06am, Tue 08 Aug, 2006

Postby Balitas » 3:57pm, Sat 24 Jan, 2009

Now in phplist 2.10.8 the solution of yicktan works partially.

New subscribers make confirmed, but now receive email confirmation. Help please!
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Postby Balitas » 4:12pm, Sat 24 Jan, 2009

Sorry, solution was found by jiminy:

To disable it find the line (also in subscribelib2.php):

if (sendMail($email, getConfig("subscribesubject:$id"), $subscribemessage,system_messageheaders($email),$envelope,1)) {

and replace it (by commenting it out) with:

// if (sendMail($email, getConfig("subscribesubject:$id"), $subscribemessage,system_messageheaders($email),$envelope,1)) {
if (true) {
Need a website? Enter to www.balitas.com
Balitas
PL Geek
 
Posts: 82
Joined: 2:17am, Mon 13 Feb, 2006

Re: Disable subscription: Solution is here

Postby szucsati » 8:54am, Fri 12 Mar, 2010

Here's a mod how to completely disable subscription from the front end.

1. Open /index.php.

2. For giving a blank page if someone tries to open the subscription page, find this part (near line 214, ver 2.10.10):

Code: Select all
    switch ($_GET["p"]) {
      case "subscribe":
        $success = require "admin/subscribelib2.php";
        if ($success != 2) {
          print SubscribePage($id);
        }


And comment out the print line (you may also add a message):

Code: Select all
    switch ($_GET["p"]) {
      case "subscribe":
        $success = require "admin/subscribelib2.php";
        if ($success != 2) {
       //   print SubscribePage($id);
        }
       echo "Subscription Disabled";


3. For removing the subscription link from the front end's open page, find this part (near line 262, ver 2.10.10):

Code: Select all
    while ($row = Sql_Fetch_Array($req)) {
      $intro = Sql_Fetch_Row_Query(sprintf('select data from %s where id = %d and name = "intro"',$tables["subscribepage_data"],$row["id"]));
      print $intro[0];
      printf('<p><a href="./?p=subscribe&id=%d">%s</a></p>',$row["id"],$row["title"]);
     }
  } else {
    printf('<p><a href="./?p=subscribe">%s</a></p>',$strSubscribeTitle);
  }


And comment out the links:

Code: Select all
    while ($row = Sql_Fetch_Array($req)) {
      $intro = Sql_Fetch_Row_Query(sprintf('select data from %s where id = %d and name = "intro"',$tables["subscribepage_data"],$row["id"]));
      print $intro[0];
//     printf('<p><a href="./?p=subscribe&id=%d">%s</a></p>',$row["id"],$row["title"]);
     }
  } else {
//    printf('<p><a href="./?p=subscribe">%s</a></p>',$strSubscribeTitle);
  }
szucsati
phpLister
 
Posts: 7
Joined: 8:38am, Fri 12 Mar, 2010

Re: Disable subscription: Solution is here

Postby jeremypeet » 7:22am, Sun 27 Jun, 2010

I recently upgrade my PHPLIST from v.10.10 to v.10.12

Prior the upgrade I set the subscription to automatically confirm and disabled the confirmation email by following the instructions in this forum:
-----------------
subscribelib2.php
Search for: values("%s",now(),"%s",0,%d,%d,"%s")'
Changed to: values("%s",now(),"%s",1,%d,%d,"%s")'
-----------------
and in phpadmin
Set default 1 for 'confirmed' field in table phplist_user_user

After the upgrade to v.10.12 I replicated the settings above but found that after I entered an email into the subscription page. I received the following message in the browser:

Sorry, sending the email to request your confirmation failed, please click "Reload" to try again. If it still does not work, it may be because you are listed on our "Black List", which means that you cannot receive emails from our newsletter system. In that case, please contact the administrator.

I'm not sure what to make of this, it appears that the subscription IS still being added to the list and IS being default to confirmed. Should I be concerned about this message and, if it is not a concern, how can I disable it.

The objective is:
Subscriptions are automatically confirmed
No confirmation, thanks or any other email is sent out
After subscription is entered in browser, window returns to subscribe page.

Thanks in advance for your help.
jeremypeet
phpLister
 
Posts: 9
Joined: 3:53pm, Fri 25 Jun, 2010

Re: Disable subscription: Solution is here

Postby jeremypeet » 10:20am, Sun 27 Jun, 2010

As a follow-on note; it appears that the upgrade has caused some issue with sending out. Which is perhaps the cause of the issue in my last post. I have tried processing a queue and sending a test from a message but nothing goes out. The event log states:
Mailer Error: SMTP Error: The following recipients failed:
Guess the upgrade didn't go a smoothly as first anticipated.
jeremypeet
phpLister
 
Posts: 9
Joined: 3:53pm, Fri 25 Jun, 2010

Re: Disable subscription: Solution is here

Postby aliceembroid » 12:43am, Thu 17 Mar, 2011

Help I tried to change the default value in php admin to 1 I have done this before but I have had some modifications made to my site. Now the confirmation email gets sent and I don't want it to. So when I changed it I get this message.

Error
SQL query:

INSERT INTO `embroid_plst1`.`phplist_user_user` (

`id` ,
`email` ,
`confirmed` ,
`blacklisted` ,
`bouncecount` ,
`entered` ,
`modified` ,
`uniqid` ,
`htmlemail` ,
`subscribepage` ,
`rssfrequency` ,
`password` ,
`passwordchanged` ,
`disabled` ,
`extradata` ,
`foreignkey`
)
VALUES (
NULL , '', '0', '0', '0', NULL ,
CURRENT_TIMESTAMP , NULL , '0', NULL , NULL , NULL , NULL , '0', NULL , NULL
)
MySQL said:

#1062 - Duplicate entry '' for key 'email'

I don't know what I did wrong or how to fix it. I am freeking out.
Alice.
aliceembroid
phpList newbie
 
Posts: 3
Joined: 12:36am, Thu 17 Mar, 2011

Re: Auto confirm subscription: Solution is here

Postby ndnguru » 10:54pm, Sun 05 Jun, 2011

My solution will let you autoconfirm a specific subscribe page, and leave the others as is.
Here is what I did to solve the problem:

1. I created a new subscribe page, but then copied the HTML form to my own page I created (I have a splash page where users can sign up to the newsletter). See here for more info on that:http://docs.phplist.com/CustomSubscribeForm
I added the following hidden form element to my custom subscribe form: <input type="hidden" name="autoConfirm" value="TRUE">
This allows you to have some subscribe pages use autoConfirm while others function as before where the user must confirm.

2. In subscribelib2.php:
find the line that says (somewhere around line #159):
$query = sprintf('insert into %s (email,entered,uniqid,confirmed,
htmlemail,subscribepage,rssfrequency) values("%s",now(),"%s",0,%d,%d,"%s")',
$GLOBALS["tables"]["user"],addslashes($email),getUniqid(),$htmlemail,$id,
$rssfrequency);

change that to:

if ($_POST['autoConfirm']) {
$query = sprintf('insert into %s (email,entered,uniqid,confirmed,
htmlemail,subscribepage,rssfrequency) values("%s",now(),"%s",1,%d,%d,"%s")',
$GLOBALS["tables"]["user"],addslashes($email),getUniqid(),$htmlemail,$id,
$rssfrequency);
}
else {
$query = sprintf('insert into %s (email,entered,uniqid,confirmed,
htmlemail,subscribepage,rssfrequency) values("%s",now(),"%s",0,%d,%d,"%s")',
$GLOBALS["tables"]["user"],addslashes($email),getUniqid(),$htmlemail,$id,
$rssfrequency);
}

3. in your admin settings for the subscribe page you created, copy/paste the html code from the section that is labeled "Message they receive when they confirm their subscription" which gets sent after the confirmation to the area that says "Message they receive when they subscribe" which gets sent after a user submits their email.
ndnguru
phpList newbie
 
Posts: 1
Joined: 10:42pm, Sun 05 Jun, 2011

Re: Disable subscription: Solution is here

Postby gulliver » 10:45pm, Sun 22 Jan, 2012

I've changed the value at subscribelib2.php.

This appears to auto-confirm users but still sends the requires-confirmation email - for which the suggested fix is to edit that to be a welcome-email.

I'd prefer to simply have the requires-confirmation email not be sent and for the user to instead receive the proper welcome-email.

Can that be done?
gulliver
phpList newbie
 
Posts: 1
Joined: 10:37pm, Sun 22 Jan, 2012

Previous

Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest