ListMailPRO Email Marketing Software Forums

ListMailPRO Email Marketing Software Forums => Development, Suggestions => Topic started by: mike2 on March 16, 2007, 03:54:27 am

Title: Something where I can confirm users & send welcome email
Post by: mike2 on March 16, 2007, 03:54:27 am
Ok I have a list where I know everyone that would sign up to it, but sometimes they might not actually know how to confirm there signup. ( parents, grand-parents, etc.).

I could simply make it non confirmed opt-in, but I still want to keep people from putting in crap on the form should an outsider find it.

I know the MySql code to change unconfirmed users to confirmed on this list, but that won't send them my welcome message.  What I need is a simple page or something that will change them to confirmed and send them the welcome message right away.
Title: Something where I can confirm users & send welcome email
Post by: mike2 on March 19, 2007, 06:40:22 pm
>>>> BUMP  >>>>  Dean any thoughts on this?
Title: Something where I can confirm users & send welcome email
Post by: DW on March 20, 2007, 05:05:55 pm
Mike, I have given this some thought and I didn't like leaving you hanging - I've been hard at work and haven't had time to work on this customization for you.

I envision a pop-up alert asking if you want the welcome email to be sent (if enabled) when changing a user from unconfirmed to active.

Changing the select box currently does not submit the form.  What I would do right now is (onchange) ask the question then submit the form automatically, saving all user details and sending the message if enabled/chosen.  This could happen, however, -before- you finish editing all of the users details to your liking, which might cause undesired results (I could make a note in the alert). You are a valued contributor around here so I would love to put a rush on this for you.  How urgent is it?

This will be so much easier to do (and use) when I start working AJAX into LMP.  I expect an improvement and action based on your suggestion for the next update at the latest.

Regards
Title: Something where I can confirm users & send welcome email
Post by: mike2 on March 21, 2007, 06:48:28 am
This is no rush, more of a simple luxury really for one very small list...

What you propose seems like it would work very well...

Another simple way may be just a real quick page I can browse to separately that moves all unconfirmeds on this list only to confirmed and sends the welcome email to them...

No rush, thanks a lot.
Title: Something where I can confirm users & send welcome email
Post by: DW on March 21, 2007, 06:01:53 pm
Hi Mike,

I didn't test this...
Code: [Select]
<?phpset_time_limit(0);include('./config.php');include('./admin.php');echo "<h2>Set unconfirmed users to confirmed and send welcome email</h2>";if($submit){ $list=trim($list); if(!$list || !is_numeric($list)) exit('list error - enter a list!'); echo "Submit<br>Moving List $list unconfirmed to confirmed and sending welcome email<br>"; flush(); // loop unconfirmed $rows = mysql_query("select id,email from lm_users where list = '$list' and cnf = '0';"); if(@mysql_num_rows($rows)>0){  while(list($id,$em)=mysql_fetch_row($rows)){  echo "$em<br>";  flush();   // update to active   mysql_query("update lm_users set cnf = '1' where id = '$id';");   // send welcome email (php mail)   sendwelcome($id);   usleep(500); // sleep .5 secs  } } else {  echo "No unconfirmed users on list $list<br>"; } echo "<hr>";}// formecho "<form method=post><input type=hidden name=submit value=1>List: <input type=text name=list size=3><br><input type=submit value=Submit><br></form>";?>
Title: Something where I can confirm users & send welcome email
Post by: mike2 on March 23, 2007, 06:05:46 am
Worked like a charm... as usual!

Thanks DW!
Title: Something where I can confirm users & send welcome email
Post by: mike2 on April 23, 2007, 07:46:45 pm
Ok this is working great and I want to use this on another list but in a little different way...  

I'd like to be able to run this as a cron job for one particular list and if the email hasn't been verified in say 2 hours, it auto does what it does.

Can you set it so I can do this easily...  I'd be happy to pay a few bucks if you can expedite it, let me know, thanks.
Title: Something where I can confirm users & send welcome email
Post by: DW on April 24, 2007, 05:04:14 pm
Mike,

At this time only the YMD for subscribers is recorded, so we would have to use a custom field to store the hour and minute.  This would mean either enabling the "signup-xtra.php" script to run after signup or setting the custom field with a hidden field value calculated with PHP, ie:
Code: [Select]
<input type=hidden name=user10 value="<?=date("Y-m-d H:i:s")?>">
PHP would need to be allowed in your document.  If it's an .html file we could turn it on with an .htaccess file.

Not too hard, really.. and we can run some code by enabling "daily-xtra.php" to run automatically after dailymail.

I will revisit this  - I have some paid support requests and a server setup to take care of and will be back.

Regards
Title: Something where I can confirm users & send welcome email
Post by: DW on April 25, 2007, 06:11:19 am
Mike,

Right you wanted every 2 hours not every dailymail.  Actually this will be VERY easy.  Set up a cron job for every 2 hours calling the previous script I provided.

Timing:
0 */2 * * *

Command (Example for list 1):
/usr/bin/wget -O /dev/null -T 0 http://example.com/mail/thescript.php?submit=1&list=1 1> /dev/null 2> /dev/null

If you want, put a password on it with a line like this after the admin.php inclusion (admin.php globalizes GET vars regardless of register_globals):
Code: [Select]
if($pw<>'1234') exit('denied');
Regards