WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Send Confirmation link after successful register (6 posts)

  1. elitel
    Member
    Posted 4 months ago #

    Hi,

    Where would I begin if I want to send users an Email Confirmation Link after registration?

    Right now,

    1. after submitting registration form, user information will be stored immediately in the 'wp_users' table.
    2. User login credentials will be sent in their email addresses.

    I really can't determine how to delay the insert of values in wp_users then send a confirmation link , to lessen the emails that do not actually exist.

    Thanks!

  2. bcworkz
    Member
    Posted 4 months ago #

    Well, you have to store the data somewhere. Inserting a prospective user where it would normally go makes sense as far as not moving data around. The difference would be that you need a scheduled event that occasionally goes through and deletes all users of a certain time in the DB that have not confirmed their registration.

    The multisite variant of WP actually does this for you. I don't know what would be involved in getting this enabled for single site, but that is the direction I would start looking if I were you. Good luck!

  3. elitel
    Member
    Posted 4 months ago #

    Hi bcworkz, I'm still confused but I'm gonna look for that multisite variant of WP. I've never heard of it. Thanks.

  4. bcworkz
    Member
    Posted 4 months ago #

    Every WP download has multisite capability, whether it's activated or not is decided in the installation process. Your question piqued my curiosity so I took a deeper look. Most of the related functions are in wp-includes/mu-functions.php.

    I am less convinced now that somehow porting the multisite capability to single site is practical, but it could be used as a model for a custom implementation. New registrations are stored in a table separate from the users table. This makes sense, the volume of registrations, especially those never verified, can be quite high. It would be more efficient finding such registrations and deleting them when all data needed is in the same table. Using the users and usermeta table would be less desirable.

    When a user registers, their data is stored in this table along with a datestamp and activation key. The key is included in the verification email activation link. If the user follows the link, the key is verified and if successful the user is added as an actual user.

    I did not find the relevant code, but presumably there is a scheduled event that runs on occasion and deletes any old registration entries that were never verified.

  5. elitel
    Member
    Posted 4 months ago #

    I think, that would be a good start in modifying functions.php or register.php. Thanks for your knowledge in wp. I'll mark this topic as resolved.

  6. bcworkz
    Member
    Posted 4 months ago #

    Please do not modify core files to implement this. I'm sure this can be implemented as a plugin. In fact, modifying mu-functions.php may not do you any good, it may not be loaded at all for single site installations.

    If you want to temporarily modify core files as part of an investigation, that's cool, but doing so as a permanent solution is a very bad idea.

Reply

You must log in to post.

About this Topic