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

General Discussion

Jay Chin
PLUS
Jay Chin
Courses Plus Student 3,078 Points

Any given visitor of my site presses a button, I get a notification. How do I do that?

I'm currently learning about web design, and I go through the lessons here on Treehouse I begin wondering what certain ideas of mine would like like in code.

One of those ideas is a simple button any reader of my site can press, and that I will receive a notification that that button was pressed. Say the button reads "I read this article the whole way through," the reader presses it, and then I, not the reader, receives a notification saying "Someone read the article the whole way through!" This is a lot like if someone who wasn't logged into Facebook liked your Facebook status and you get a notification for that.

Practical uses for such a thing aside, is this possible? My research tells me that there is a way to write in JavaScript and HTML something like "if this button is pressed, let's go to the default e-mail application and write out this specific message so the user can send it." But I don't want the user to send the message him/herself from an e-mail.

I imagine I need a 3rd party service, with which I can tell the site "If this button is pressed, send [code] to [3rd party service.]" And then the 3rd Party Service, receiving that message goes, "We got [code], now it's time to send the e-mail/notification he told us to."

I hope this makes sense. Maybe I'm really far off and there's a very different approach to doing something like this. I'm pretty new to this stuff, so please be patient with me.

Thank you in advance.

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Hi Jay!

What you are asking for is a back-end service. Your web page is being shown and it is the front-end. You want to submit information to a server. This is most simply done through a form submission.

There are a couple of services that do this if you don't want to write your own. Here's one that I found that seems to have some good instructions.

https://formspree.io/

You can of course learn some back-end programming here too. Let me know if you are interested there and I can help guide you in the right direction!

Hope it helps!

Jay Chin
Jay Chin
Courses Plus Student 3,078 Points

Hi Craig!

Thank you so much! I'm glad that I'm not talking total gibberish. It appears that this is still a bit beyond my skill set at the moment, but I get the general idea.

If you could tell me which courses and tracks to keep my eye out for that'll get me more familiar with this kind of stuff, I'd be most grateful.

Thanks again, Jay