Author Topic: How to avoid multiple subs. and unsubs. with the same e-mail  (Read 1918 times)

Charybdis

  • Posts: 31
    • View Profile
How to avoid multiple subs. and unsubs. with the same e-mail
« on: April 30, 2007, 10:48:01 am »
Dear Dean Wiebe,

I need your kindly support again (this is another thread than the previous).

I want to avoid multiple subscribe and unsubcribe with the same e-mail address.

For example, Joe signup with joe@gmail.com, then unsubcribe. Then again singup with joe@gmail.com. <-- I want to avoid this agin signup.

I can set only that unsubscribed addresses remain in the database.

I have some ideas:
1) with "List settings --> Additional Operations" and with 2 lists?
2) with /listmail/xtra scripts?
3) with custom php script, then subscribe with script?

Thank you for your support!

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How to avoid multiple subs. and unsubs. with the same e-mail
« Reply #1 on: May 01, 2007, 08:55:42 am »
Greetings,
Quote
3) with custom php script, then subscribe with script?

I think this way would be easiest.  The script could check the email address against removals on the list being subscribed to.  On failure, it could output a custom error page or forward to a specified URL.  On success, it could forward the user to signup.php just as if they had subscribed normally.  Let me know what you think.  This sounds like a good future built-in feature, too.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Charybdis

  • Posts: 31
    • View Profile
How to avoid multiple subs. and unsubs. with the same e-mail
« Reply #2 on: May 01, 2007, 12:10:27 pm »
Ok, I write a script. This script uses a separate database. If someone want to subscribe, then this script handle data first. If the given e-mail already exist in database, then throws error. Else the script inserts the e-mail in the database, then forward data to signup.php.

In this way should work, right?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How to avoid multiple subs. and unsubs. with the same e-mail
« Reply #3 on: May 01, 2007, 12:48:32 pm »
Yes, that sounds right, although you could write the script to simply automatically check the ListMail database, lm_users table, for a "Removed" user by looking for "cnf" with a value of "0".

If placed in the ListMail folder you can have the database connection created by admin.php

Code: [Select]
<?phpinclude('./config.php');include('./admin.php');list($found)=@mysql_fetch_row(mysql_query("select id from $utable where list = '".addslashes($list)."' and email like '".addslashes($email)."' and cnf = '0';"));if($found){ // user was removed, forward to error page or  exit('no can do');} else { // not found removed, continue to signup  // signup - currently this supports only 3 custom fields header("Location: ./signup.php?list=$list&email=".urlencode($email)."&fname=".urlencode($fname)."&lname=".urlencode($lname)."&user1=".urlencode($user1)."&user2=".urlencode($user2)."&user3=".urlencode($user3));}?>

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting