Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Website Membership: Slow Signup Emails

 

 


zip222
User

May 10, 2011, 8:41 AM

Post #1 of 15 (9039 views)
Shortcut
Website Membership: Slow Signup Emails Can't Post

I am using the membership plugin on a site and when a new user signs up there is usually, but not always, a long delay before they receive the email. It appears to be sending right away, but it doesn't arrive in their inbox until some time later - as much as an hour.

Is this a plugin issue, or a server issue? Any idea how to resolve it?


Jason
Staff / Moderator


May 10, 2011, 10:00 AM

Post #2 of 15 (9038 views)
Shortcut
Re: [zip222] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi,

The membership plugin uses the php mail() function, which just passes the email to your mail server which queues up and send the emails.

You can contact your hosting provider and find out if there's anything that would delay your emails (ie, high traffic, daily limits, etc).

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


zip222
User

May 10, 2011, 12:38 PM

Post #3 of 15 (9033 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Based on what I have found, the host only sends these emails once every 15 minutes, at most. Ugh.

Is there another way around this? Can I bypass the initial email with temporary password and just give the user immediate access to the site once they complete the signup form?


Jason
Staff / Moderator


May 10, 2011, 2:15 PM

Post #4 of 15 (9028 views)
Shortcut
Re: [zip222] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi,

Probably the best way around this would be to allow them to set their own password instead of creating a temporary one for them. That way they'll only need to receive an email if they forget their password.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


zip222
User

May 13, 2011, 5:36 AM

Post #5 of 15 (8954 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Would you be able to give me a little guidance for doing this? The previous version of the plugin was setup this way by default, but the newer versions are not.


Jason
Staff / Moderator


May 13, 2011, 9:41 AM

Post #6 of 15 (8947 views)
Shortcut
Re: [zip222] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi,

Sure. First, you'll have to customize the form to give them a place to type in their password. Normally you'll want them to type them in twice and compare them to make sure they're the same. For example:


Code
<tr> 
<td>Password</td>
<td><input type="password" name="password" value="<?php echo htmlspecialchars(@$_REQUEST['password']); ?>" size="50" /></td>
</tr>
<tr>
<td>Re-enter your password</td>
<td><input type="password" name="password2" value="<?php echo htmlspecialchars(@$_REQUEST['password2']); ?>" size="50" /></td>
</tr>


Then you'll want to add some error checking to ensure the two match:


Code
// error checking 
$errorsAndAlerts = "";
if (!@$_REQUEST['fullname']) { $errorsAndAlerts .= "You must enter your full name!<br/>\n"; }
if (!@$_REQUEST['password']) { $errorsAndAlerts .= "You must enter a password!<br/>\n"; }
elseif (@$_REQUEST['password'] != @$_REQUEST['password2']) { $errorsAndAlerts .= "Your passwords don't match! <br/>\n";}

if (!@$_REQUEST['email']) { $errorsAndAlerts .= "You must enter your email!<br/>\n"; }
else if(!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "Please enter a valid email (example: user@example.com)<br/>\n"; }
if (!@$_REQUEST['username']) { $errorsAndAlerts .= "You must choose a username!<br/>\n"; }


Finally, you need to remove the code that produces the random password. Remove this line:


Code
$_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 15); // example output: c5560251ef0b3eef9


After that, you can remove the code that sends the email.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 

(This post was edited by Jason on May 13, 2011, 10:15 AM)


zip222
User

May 13, 2011, 10:14 AM

Post #7 of 15 (8944 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Great. Thanks for your help.

Note, in case someone else tries to use this, there is a typo in the password error checking - need to remove the space in "password 2"


Jason
Staff / Moderator


May 13, 2011, 10:15 AM

Post #8 of 15 (8942 views)
Shortcut
Re: [zip222] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi,

Good catch! :) I've edited the post to reflect that change.

Thanks
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


zip222
User

May 13, 2011, 10:33 AM

Post #9 of 15 (8938 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

I am having a different issue with the update account page. Once a user logins and then goes to the Update Account page, I have included fields for address, phone, etc. If they enter a phone number or have previously entered on, and then they update their password, they get prompted by the browser to "remember the password for [PHONENUMBER]" rather than for the username or email. If I click yes, it also logs me out of the system. Any idea why that would be happening?

Page code attached.


(This post was edited by zip222 on May 13, 2011, 10:33 AM)
Attachments: account.php (8.00 KB)


Jason
Staff / Moderator


May 16, 2011, 9:33 AM

Post #10 of 15 (8761 views)
Shortcut
Re: [zip222] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi,

Do you get logged out whenever you update your password, or only when you update your password and have information in your phone field?

Let me know,
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


goodonyx
New User

Oct 12, 2011, 9:20 AM

Post #11 of 15 (7135 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Thanks! This code helped for what I needed too. Is is possible to log the user in automatically since they are setting their password during registration? Currently the user has to click on the login link and enter their credentials to log in. Just wanted to see if it could be easier for the registrant.

thanks,

Tim


Jason
Staff / Moderator


Oct 12, 2011, 10:03 AM

Post #12 of 15 (7132 views)
Shortcut
Re: [goodonyx] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi Tim,

Yes, once you've created the user account, you can trigger a login.

In order to do this, we need 3 variables in the $_REQUEST array: username, password, and action.

After that we can call the _websiteLogin_login(); function from the Website Membership plugin, which will complete the login.

For example:


Code
@$_REQUEST['action'] = "login"; 
_websiteLogin_login();

$errorsAndAlerts = alert();


This code assumes that $_REQUEST['username'] and $_REQUEST['password'] still have values in them from the form. If they don't you need to give them values. Also, if you are using password encryption, you must assign the unencrypted password to the $_REQUEST['password'] variable.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


Toledoh
Enthusiast

Mar 25, 2012, 8:51 PM

Post #13 of 15 (3060 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi Guys,

Is this still the same process with the latest version of the membership plugin?

I'm not sure whether to delete just the first line, or all three lines below;


Code
      // generate password 
$password = substr(md5(uniqid(mt_rand(), true)), 15); // example output: c5560251ef0b3eef9
if (@$SETTINGS['advanced']['encryptPasswords']) { $passwordHash = getPasswordDigest($password); }
else { $passwordHash = $password; }


I've tried both, and I've tried changing bits and pieces of;


Code
password         = '".mysql_escape( $passwordHash )."',


but the password entered via the form, doesn't seem to get added to the admin, and I was thinking it had something to do with the encryption?
Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au


Jason
Staff / Moderator


Mar 26, 2012, 10:07 AM

Post #14 of 15 (3012 views)
Shortcut
Re: [Toledoh] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi Tim,

Is nothing getting added to the user account in the password field? Is the rest of the record created properly?

If you could attach your entire .php file, we can take a closer look at this for you.

Thanks,
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


Toledoh
Enthusiast

Mar 26, 2012, 3:06 PM

Post #15 of 15 (3011 views)
Shortcut
Re: [Jason] Website Membership: Slow Signup Emails [In reply to] Can't Post

Hi Jason,

Uhhhmmm. seems to be magically working now

Blush

Thanks!
Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au

(This post was edited by Toledoh on Mar 26, 2012, 3:06 PM)
Attachments: user-signup_v2.php (12.9 KB)