hackforla / 311-data

Empowering Neighborhood Associations to improve the analysis of their initiatives using 311 data
https://hackforla.github.io/311-data/
GNU General Public License v3.0
61 stars 62 forks source link

Spike: Fix contact form to use frontend-only service #1536

Closed edwinjue closed 6 months ago

edwinjue commented 1 year ago

Overview

We need to fix entire workflow from when submit button gets clicked on the contact form to having the submission appear in a github issue, so that we can know when to process requests.

Action Items

Resources/Instructions

Original code locations

alexlaw528 commented 1 year ago

@edwinjue A potential solution we can employ is to trigger a Github Action whenever a user makes an Issue request. We'll need someone with pull request access to make a access token since there's no way to create an issue without providing credentials .

Can you create a Personal Access Token and add it to Github secrets so I can use for testing? I don't have rights to do this on the 311 repo.

edwinjue commented 1 year ago

@alexlaw528 Thank you so much for being so proactive on this! I will take a look when I have some time in the evening. In the meanwhile, feel free to fork our main branch into your own personal github repo to get started. Once we have something working on your own personal repo, we can work together to port it over to 311-data. I really appreciate it and will follow up later!

ryanfchase commented 7 months ago

@traycn 's suggestions (she will expand on these in her work)

traycn commented 7 months ago

Availability: 2/2 - 2/5: 4AM - 9AM PT

Skydodle commented 7 months ago

@traycn thank you so much for picking up this issue! Just a gentle reminder to move this issue to 'in progress' on the Project Board as soon as you assign yourself so that this issue will no longer be on the 'priortized backlog' for other devs to pick up. Thanks again!

traycn commented 6 months ago

Solution Proposal:

Add 2 events after the existing form is submitted. For reference to the data we are using, the values we are collecting on the forms submit are below.

// Contact Form field values:
{
     FirstName,
     LastName,
     Email,
     Association (optional),
     Message
}

Event 1: Create a new Github Issue:

Create a Github Issue using Octokit/Core.js. Documentation for the Create an issue POST here.

Event 2: Send an email using EmailJS

Documentation for the sendForm() function here.


Development work:

Loc: 311-data.components.contact.ContactForm.jsx

Event 1:

For the 311-Data repo

Event 2:

For the 311-Data repo

-- Let me know your thoughts on this proposal @ryanfchase @edwinjue

traycn commented 6 months ago

Created new issue for the Spike item: https://github.com/hackforla/311-data/issues/1682