Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Dave Faliskie
Dave Faliskie
17,781 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,781 Points

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