4 Replies Latest reply on May 27, 2011 7:36 AM by Dan Bracuk

    Confirm email registration using CF

    barrow0204 Level 1

      We have a form for users to subscribe to email newsletters. They sometime put in bad email addresses, so I want to create the form so it then sends out an email with a confirmation link. Once they have clicked the link, then they are approved and get the newsletters.

       

      Is this possible using Coldfusion? If so, any suggestions of where to start would be very gratefully received.

        • 1. Re: Confirm email registration using CF
          Owain North Level 4

          Of course it's possible!

           

          As it's no longer a stateful transaction, you'll need to store some details in a database. Here's what I'd do:

           

          User signs up, which inserts a row into your "pending_signups" table, which has an id, any dates you want and the email address. You then email the person with a link to a confirmation page with a url parameter of the signup id. Whether you choose to encrypt this is up to you, depends on the system.

           

          When the user hits the link, the confirmation page checks the id from the url and signs up the stored email address to your mailing list.

           

          Job done.

          1 person found this helpful
          • 2. Re: Confirm email registration using CF
            barrow0204 Level 1

            I'll have a go and hopefully it should be no problem for a newcomer like me. I've got an expert in the office to quiz as I go. Cheers

            • 3. Re: Confirm email registration using CF
              Leonard B Level 2

              Hi barrow,

               

              If I read part of your post correctly, portion displayed below. You are indicating the receipt of a bad e-mail address and that you want to send a confirmation to the bad e-mail address for them to confirm submission. If the e-mail address is bad not sure how the confirmation with subsequent link is going to make it to the destination.

              barrow0204 wrote:

               

              They sometime put in bad email addresses, so I want to create the form so it then sends out an email with a confirmation link.

              Now given that the submitted e-mail address is valid/good, then Owain's information would to me be the preferred way to verify that the person for whom the e-mail address belongs to in fact does want to receive your information and is not being submitted without their consent or knowledge.

              Another option to consider although will not verify bad or good, is to have them enter the e-mail address twice. Then on submission use the compare function to check to see if they entered the e-mail address exactly the same. This would at least attempt to catch any typos the submitter may have done.

              Leonard B
              • 4. Re: Confirm email registration using CF
                Dan Bracuk Level 5

                Regarding the suggestion to enter the email address twice - whenever I see that on a page, I enter it once then copy and paste.