How Opt-in forms work from a php perspective?

13 replies
Hi Warriors,

I'm new to this forum and certainly to Email Marketing, well, I'm stupid when it comes to the last...

My question is: How does the opt-in process work from a programming perspective?

I explain my doubts.
I understand that whatever emailing service you are using, you need to gather subscriptors, you do this by puting a form on your site for the users to "register" or "subscribe" to your mailing list and once the users complete the form, they send the data to your Email Marketing provider... am I right? (I think yes).

Now, I'm planning to offer a service and I only ask users to "register" in order to get access to it ( I ask for email, age, gender, and city ), I want to know which user has confirmed his email so I can "Activate" his account and also know when they opt-out so I can remove his account from my service.

I wonder if this is possible, because all Email Marketing providers have their own Opt-in forms and AFAIK you have no control on them.

I hope you guys can give some light on this.

I apologize if my question is redundant or not clear.
Thanks a lot!
#email marketing #forms #opt-in forms #optin #perspective #php #work
  • Profile picture of the author WillR
    Originally Posted by Manuel Ramirez View Post

    I want to know which user has confirmed his email so I can "Activate" his account
    Not sure that many (any) third party autoresponders have this type of functionality. It would have to be done through some form of API I would imagine.

    A much easier way to do things is to just have their account created automatically when they signup and send the login url only after they have confirmed their email address. This way if they do not confirm their email address they will never get that email and won't be able to access or use their member account.

    Originally Posted by Manuel Ramirez View Post

    and also know when they opt-out so I can remove his account from my service.!
    To remove people from a list is quite easy but it depends on what autoresponder you are using. Aweber for example allow you to unsubscribe people via email so you can easily set up your membership script to send the required email to Aweber when someone unsubscribes thus removing their email from your Aweber list.

    https://help.aweber.com/entries/2165...ple-Via-Email-
    {{ DiscussionBoard.errors[8392484].message }}
    • Profile picture of the author Manuel Ramirez
      Hi WillR,

      Thanks for your prompt response!

      A much easier way to do things is to just have their account created automatically when they signup and send the login url only after they have confirmed their email address. This way if they do not confirm their email address they will never get that email and won't be able to access or use their member account.
      What I don't understand is how can I know that the user has confirmed his email address if the confirmation link is sent from the 3rd party autoresponder and not my website, AFAIK, the register form sends the data to the autoresponder.

      Also, can I process the data before it's sent to the autoresponder?

      To remove people from a list is quite easy but it depends on what autoresponder you are using. Aweber for example allow you to unsubscribe people via email so you can easily set up your membership script to send the required email to Aweber when someone unsubscribes thus removing their email from your Aweber list.
      Each email that we send, has the Opt-out link, when the user clicks on it, it goes directly to the autoresponder for deletion, the only way I know to get notified is by checking the report that shows who opted out, so how can I automate this notification?

      Maybe I'm too newbie to all of this, it's just I want to think out of the box and get to know all details before I pay for the service.
      {{ DiscussionBoard.errors[8392573].message }}
      • Profile picture of the author WillR
        I think you are over-thinking things a little.

        Originally Posted by Manuel Ramirez View Post

        What I don't understand is how can I know that the user has confirmed his email address if the confirmation link is sent from the 3rd party autoresponder and not my website, AFAIK, the register form sends the data to the autoresponder.
        Your membership software should notify Aweber (or whatever autoresponder you use) of the new members email address. With Aweber this is done using something known as an email parser.

        As I said above just put the login url in the first email they get after confirmation. This way if they do not confirm their email address then they won't get access to those login details and won't be able to access your site. No need to overcomplicate this. If they don't confirm their email address, yes, their account will still be created inside your site but they won't be able to use it, so it's no big deal. I don't think any autoresponder system is setup in any way to notify you when a subscriber finally double optins.

        Personally I would just use single optin for something like this anyway... and I do for several free membership sites setup in this exact same way.

        Originally Posted by Manuel Ramirez View Post

        Each email that we send, has the Opt-out link, when the user clicks on it, it goes directly to the autoresponder for deletion, the only way I know to get notified is by checking the report that shows who opted out, so how can I automate this notification?
        Again, I don't see any huge importance in knowing who has opted out of your emails. If it's a free membership website then even if someone opts out of your emails I would still just leave them as a member of your site. What have you got to lose by leaving them if it's free anyway?
        {{ DiscussionBoard.errors[8392702].message }}
        • Profile picture of the author Manuel Ramirez
          Originally Posted by WillR View Post

          I think you are over-thinking things a little.



          Your membership software should notify Aweber (or whatever autoresponder you use) of the new members email address. With Aweber this is done using something known as an email parser.

          As I said above just put the login url in the first email they get after confirmation. This way if they do not confirm their email address then they won't get access to those login details and won't be able to access your site. No need to overcomplicate this. If they don't confirm their email address, yes, their account will still be created inside your site but they won't be able to use it, so it's no big deal. I don't think any autoresponder system is setup in any way to notify you when a subscriber finally double optins.

          Personally I would just use single optin for something like this anyway... and I do for several free membership sites setup in this exact same way.



          Again, I don't see any huge importance in knowing who has opted out of your emails. If it's a free membership website then even if someone opts out of your emails I would still just leave them as a member of your site. What have you got to lose by leaving them if it's free anyway?
          You are right, I'm getting too complicated.

          Maybe I dont understand some things with my little knowlede on this

          That "email parser" sounds interesting, so I can process the data in my site first and then send it to aweber after user confirmed email right?

          I agree with you on leaving accounts active even after opt-out.

          Finally I think I got it.
          {{ DiscussionBoard.errors[8392747].message }}
        • Profile picture of the author arojilla
          I'm starting my first list and I'm doing my own coding instead of going with a third party (Aweber and the like) which I think is not what you are doing but since you asked "from a php perspective" I'll tell you how I did it (which is how it's made most of the times) in case you find something of interest. These are the steps:
          1. There is a html form that points (action) to a php file.
          2. This php file gets whatever the user puts in the form (I use javascript to prevent empty forms).
          3. Then comes some checking: is there an email (javascript not always works), does it looks like a valid email, does it contain insecure stuff, has it been used before...
          4. If a problem is found the user gets a warning telling him what is wrong (either directly by AJAX or refreshing the whole form page).
          5. If no problem, data is saved and a unique code with a random number and the timestamp is generated.
          6. An email is automatically sent to the user containing a confirmation link that points to the php file with the unique code attached to it (like site.com/confirm/893746283945367).
          7. If the user opens the email and clicks the confirmation link, he goes to the same or other php file that then updates the email as confirmed and the user is able to receive emails.
          8. Every X hours or days, a cronjob checks for unconfirmed emails that are older that Y days and removes them from the database.
          9. In future emails there will be an unsubscription link with the user's code (site.com/unsub/893746283945367) and if the user clicks it two things can happen: either the php removes the email from database or leaves it but flagged as unsubscribed (not receiving more emails) or the user is sent a unsubscription email just like when he subscribed.

          And that's it.
          Signature

          [...]

          {{ DiscussionBoard.errors[8392794].message }}
          • Profile picture of the author Manuel Ramirez
            O
            Originally Posted by arojilla View Post

            I'm starting my first list and I'm doing my own coding instead of going with a third party (Aweber and the like) which I think is not what you are doing but since you asked "from a php perspective" I'll tell you how I did it (which is how it's made most of the times) in case you find something of interest. These are the steps:
            1. There is a html form that points (action) to a php file.
            2. This php file gets whatever the user puts in the form (I use javascript to prevent empty forms).
            3. Then comes some checking: is there an email (javascript not always works), does it looks like a valid email, does it contain insecure stuff, has it been used before...
            4. If a problem is found the user gets a warning telling him what is wrong (either directly by AJAX or refreshing the whole form page).
            5. If no problem, data is saved and a unique code with a random number and the timestamp is generated.
            6. An email is automatically sent to the user containing a confirmation link that points to the php file with the unique code attached to it (like site.com/confirm/893746283945367).
            7. If the user opens the email and clicks the confirmation link, he goes to the same or other php file that then updates the email as confirmed and the user is able to receive emails.
            8. Every X hours or days, a cronjob checks for unconfirmed emails that are older that Y days and removes them from the database.
            9. In future emails there will be an unsubscription link with the user's code (site.com/unsub/893746283945367) and if the user clicks it two things can happen: either the php removes the email from database or leaves it but flagged as unsubscribed (not receiving more emails) or the user is sent a unsubscription email just like when he subscribed.

            And that's it.
            That's what I've done so far! My concern is not to be a spammer that's why I been thinking on a 3rd party emailer.

            The problem came out when I started re-thinking how could I feed my database and 3rd party's at the same time.

            Thank you all, I really appreciate it. Learned a.lot today!
            {{ DiscussionBoard.errors[8392835].message }}
            • Profile picture of the author dad2four
              [QUOTE=Manuel Ramirez;8392835]My concern is not to be a spammer that's why I been thinking on a 3rd party emailer.
              QUOTE]

              You are on the money with your choice here, stay with the third party list service.

              WillR has steered you well.

              Always go with KISS Principal(Keep it simple stupid). Anything else will cost you in time, money, headaches etc.

              :-)

              Good Luck
              Signature
              {{ DiscussionBoard.errors[8392860].message }}
            • Profile picture of the author arojilla
              Originally Posted by Manuel Ramirez View Post

              My concern is not to be a spammer that's why I been thinking on a 3rd party emailer.
              That's a valid concern. If you want to play safe go with a third party.

              The problem came out when I started re-thinking how could I feed my database and 3rd party's at the same time.
              I'll do it for myself or go with the third party, but personally I wouldn't mix both methods. Now if they, for example, let you export the list of active or bounced emails then I think is doable (like in parse their list every X hours, compare it with your list and then update your database). But I have never worked with a third party so I don't really know how it could work.

              I'll go with my own solution because I'm a control freak and a programming geek that enjoys a good challenge. I don't fear being tagged as spammer because of the two lists I'll make, in one, which is for a game, always only a very very small set number of users will be sent an email at a time (it's part of the game) and in the other I'll only send one or two emails a month so I have a lot of time to queue them (like in "send 100 emails every 10 minutes", which lets you send more than 14 000 emails a day or 100 000 a week). Then of course I'll try to follow these guidelines:

              http://support.google.com/mail/answer/81126?hl=en

              EDIT: edited link
              Signature

              [...]

              {{ DiscussionBoard.errors[8392976].message }}
  • Profile picture of the author hustlinsmoke
    I have ran across some really good optin plugins have you checked that route yet.
    {{ DiscussionBoard.errors[8392580].message }}
    • Profile picture of the author Manuel Ramirez
      Originally Posted by hustlinsmoke View Post

      I have ran across some really good optin plugins have you checked that route yet.
      Not really, I'm asking Mr. Google right now.

      Have any recommendations?

      Thanks!
      {{ DiscussionBoard.errors[8392625].message }}
  • Profile picture of the author hustlinsmoke
    I use wp autoresponder although in download form it doesn't work right. I was given the code and fix it. I also use wp leads, wp landing pages.
    I use mandrill.com to send. I just did this Im testing my first blast now with mandrill.

    Everyone will tell you here and say............OH NOW DON'T DO IT YOURSELF, USE AWEBER OR GETRESPONSE..........

    Most are affilates of them, So far I have a 100 percent delivarable rate and there getting opened and clicked on better than aweber or getresponse.

    I have not let those accounts go yet but after today I am sure to do it.

    Don't be Brain washed by others, if we did what everyone states then Colonel Sanders wouldn't have made it nor Dave Thomas,
    {{ DiscussionBoard.errors[8393324].message }}
  • Profile picture of the author brutecky
    When I write scripts like this what I do is.

    1) Collect there name / email etc.
    2) of course validate and sanitize the data as much as a I can, things like make sure the email is in proper format etc.
    3) Create an account for them in the membership sites database, the database has a field that is a Boolean flag, 0=not confirmed email 1=confirmed
    4) Send them an email with PHP for them to click a link to confirm there account.
    5) When the click the link it runs a script that changes that flag to 1 it also uses the auto responder API of choice to then add them to my list

    Net results:

    A) User has an confirmed account
    B) You have an email knowing that it was provided by a confirmed user

    While you need some PHP knowledge to do this on a 1-10 scale of difficulty its only about a 3.5
    {{ DiscussionBoard.errors[8393375].message }}
    • Profile picture of the author Manuel Ramirez
      Thanks a lot guys,

      I got far more information than I thought and I learned many things today.
      I'll report back my status on this project and hopefully do some link exchange.

      Thanks again, Cheers to this forum!

      Manuel.
      {{ DiscussionBoard.errors[8394238].message }}

Trending Topics