treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Need help with a monthly email update form.

  • Hey all,

    Not sure if this is the right section to post this in but if it isn't, please direct me to the proper place.

    On my site (wordpress based), I want my visitors to be able to sign up for a monthly e-mail update. right now I have a little form with a graphical button on the upper right hand corner using this code:

    <form action="#" id="updates">
    <label for="email">Get email updates</label>
    <input type="text" name="email" class="email_field" />
    <input type="submit" name="submit" class="submit_button" value="" />
    </form>

    Obvisouly, it doesn't do anything at this time. I thought of using a service but its really only for family and close friends so the amount of e-mails being sent out are minimal. I already created the html file for my email and I'll be using thunderbird to send them out (just like Chris showed in one of his screencasts.) So, I guess what I need this to do is send an e-mail to me saying: "this email address name@email.com would like a monthly email update." Can I use the WP plug-in of contact form 7 to make this work?

    Thanks guys!
  • You should point that action URL (and add method="post") to a PHP file with something like this in it:

    <?php

    $Email = Trim(stripslashes($_POST['email']));

    $Body = "This email should be added to the list: $Email";

    $success = mail("youremail@email.com", "New Subscribe", $Body, "From: youremail@email.com");

    ?>
  • "chriscoyier" said:
    You should point that action URL (and add method="post") to a PHP file with something like this in it:

    <?php

    $Email = Trim(stripslashes($_POST['email']));

    $Body = "This email should be added to the list: $Email";

    $success = mail("youremail@email.com", "New Subscribe", $Body, "From: youremail@email.com");

    ?>



    Cool, thank you Chris!!