Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Dave Faliskie
Dave Faliskie
17,793 Points

Email newsletter sign up

I have a simple website that I want to add a field that will ask a user to enter an email. I want it to sign them up for a reoccurring newsletter.

I would like their email address to go to some sort of contact list where I could just create an email and send it to everyone signed up.

anyone who has done this type of thing before and could point me into the right direction to do this would be awesome.

2 Answers

Aaron Graham
Aaron Graham
18,033 Points

I would just save them in a database. I suppose if you were looking for quick and dirty, you could just write them out to a text file but I don't know how well that would scale, and if you aren't careful, your file could end up being readable through directory traversals and the like. The database seems like the best solution.

Dave Faliskie
Dave Faliskie
17,793 Points

Thanks for the response I ended up using MailChimp for anyone who might have a similar problem. Very easy to use!