1 Reply Latest reply on Aug 2, 2009 3:50 PM by DwFAQ

    Update emial address with confirmation link




      I am using registration process like this one, described at Mr Schenk web:




      There is e-mail adress, used in registration process  to activate account  by clicking a link.


      I am going to give  a possibility to change(update) that email address in user profile but in safe way. For example with additional  password checking and email sending to the new address with confirmation  link which should by clicked to make change.


      Is there any simple method implemented in Developer Toolbox? Maybe I should use 'send email' trigger with content which include earlier preapered url (confirmation link) ?


      Thanks in advance.

        • 1. Re: Update emial address with confirmation link
          DwFAQ Level 4



          Use an insert record form with send email trigger. I would have another db table for "new address" with fields for user_id(foreign key based off session variable), new_email, random_key, email_confirmed that passes users id and new_email to the table and generates a random key. Then send email SB to new address. In content of send email have a generated URL of confirmation_page.php?URL parameter of random key&URL parameter of new_email&URL parameter for user_id.


          In confirmation_page have MySQL update "new address" table for email_confirmed field where URL parameter for random key && URL parameter for new_email == table fields in "new address" database. Have it write over any other record in the table based off query where user_id in table == user_id from URL parameter && URL parameter random_key && new_email so any "old, new email addresses" for the user will be overwritten in the database. Then place a MySQL update table where email_confirmed is set on "new address" table to update "users" table for new email address based on foreign key user_id.


          This is not really something that is entirely available out of box from ADDT. You would have to use a combination of insert record SB+send email+ MySQL hand coding. The explanation should give you enough to go on if you know some code.


          Good luck!

          1 person found this helpful