EvictionLab / eviction-lab-website

https://evictionlab.org/
4 stars 5 forks source link

Set up Contact Us #127

Closed james-minton closed 6 years ago

james-minton commented 6 years ago

Hi @pjsier and / or @Lane (whoever has a free moment first) --

I will need some help setting up a form and its routing for Contact Us (page is /contact on cms-dev). I have the text set up on the page, but need assistance with the mechanics of it (what service sends the email? How to code the form to make that happen? Etc.)

Here's the structure:

To get in touch, please select your reason for contacting us from the dropdown menu, then fill out the form below.

Dropdown (selection determines email address to which form submits):

  • I need help with using the site, or have feedback on how to make it better
  • I'm a researcher and have questions, or would like to share my own research
  • I'm a member of the press / media, or would like to discuss a speaking engagement
  • I have general questions or comments

Fields:

email message submit


You can also send emails regarding

  • Help requests or site feedback to help@evictionlab.org
  • Research inquiries to research@evictionlab.org
  • Media inquiries to media@evictionlab.org
  • General questions or comments to info@evictionlab.org

If you would like to merge your data with data from the Eviction Lab, please use our Data Merge Application [link].

pjsier commented 6 years ago

I'm not sure we decided yet how to implement this. We'll either have to use some service, or potentially make an AWS Lambda function that forwards the messages. Formspree looks promising. Not sure how much traffic we're expecting on the contact forms, but it looks like it essentially forwards the email content.

All we'd have to do in terms of JavaScript is have a change listener on the contact type dropdown that updates the form email recipient whenever it's updated.

Thinking through this a bit, I think Formspree is probably our best option for now. At the very least it buys us some time to find something else if we decide another route works better.

james-minton commented 6 years ago

Formspree does look good. God help us if we get more than 1000 emails a month.

I'll try the change listener thing, and let you know if I get stuck. Thanks!

james-minton commented 6 years ago

Happy Easter, Pat! No need to tackle today, but FYI I had some success experimenting with a change listener, but can't get it to do what I need to do: make the dropdown selection state change the action attribute of the form so it routes to the correct email address.

I think what we could do for now is use this data-email attribute I've set up in the dropdown as the thing that goes into the form action, just as a test. If you could get that working with the right script, I can later plug in the right formspree link. Thanks!