0

Would anybody be so kind and guide me through how to create an email sign up form for WordPress which does the following:

  • Visitors enter email address, it validates it and inserts into the database with a message either success/error
  • An option to be able to see subscribed users on the admin site (and if its not too much an inconvenience, the ability to manage (delete) from the list)

I was going to ask about automatic unsubscribing, but there is no point as emails would be sent from a different platform. If the option is available to manage the list, it would be easy to maintain a clean list.

For some more experienced people I guess it is like a few minutes job, unfortunately I couldn't find any guides related to WordPress. I would like to achieve the understanding of the basics, how and why is it working that way.

2
  • If you really want to do this yourself, break it down to steps that you would need to do (which you almost have). Now you have bunch of questions that already has been answered hundreds of times.
    – N00b
    Commented May 8, 2016 at 10:54
  • ive spent the past 3 hours trying to find those questions and answers, havent succeeded... :(
    – nesh
    Commented May 8, 2016 at 10:59

1 Answer 1

2

First of all, don't reInvent the wheel, it's a wastage of time, money - everything.

  • If you want to stick with the WordPress' way, better be with a Custom Post Type. Create a custom post type for storing emails in its postmeta.
  • Make a form, and save the values to the CPT's postmeta
  • Make a Menu Page and do use the Settings API and make your email template settings.
  • As per the settings, send your emails through wp_mail()
  • If you want to make your own table, go with $wpdb, and you know the rest

I think this is it. But...

Just read this article today, quoting from there on first hand:

It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.

For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages.

There are many issues, you need to consider before reInventing the wheel:

  1. Wastage of Time
  2. Wastage of Money
  3. You need a heavy mailer that doesn't ban (or make spam) your mails in the user end
  4. You need email templates that supports various email clients, and behave normally
  5. And so on...

Better rely on a better plugin (plugin doesn't always mean that they are bad) or any 3rd party service. I know Mailchimp is a nicer solution. But there are many you can rely.

1
  • Hey, thanks for your answer! whooha! Its quite a bit to read, i will try to get through as soon as i can! i understand that it is kind of reinventing the wheel, however i need the knowledge to be able to understand the hows and whys... i thought it was kind of going to be a simple HTML code for the input and button, and a short function to get it in the database, and a bit longer function to display and edit... it seems to be that is more than that! haha
    – nesh
    Commented May 8, 2016 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.