Iridescent-CM / technovation-app

The team submission platform for the Technovation Challenge
https://technovationchallenge.org
GNU General Public License v3.0
7 stars 4 forks source link

Send parental and media consent copies in PDF format in confirmation emails to parent/guardians #3045

Open rsgonzal opened 2 years ago

rsgonzal commented 2 years ago

Background After the parent/guardian signs the parental consent and the media consent, they get a confirmation email (for each one) with a copy of consent form.

Deliverable Update these confirmation emails so the consent forms that are included are in PDF format.

rsgonzal commented 2 years ago
rsgonzal commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @viviancan @shaunxp20

rsgonzal commented 2 years ago

Tip: Look at parental consent form that students can download from their dashboard with name & info filled in

shaun-technovation commented 2 years ago

I was looking at this last week, and couldn't get our PDF library, "wkhtmltopdf" to render the consent forms as PDFs. Given that the parental consent is already sent as plain text, I just made the media consent one the same. Hopefully we can revisit this when we get some more breathing room. :smile:


Some notes on what I tried.

I couldn't get this to work through the app so I tried it from the rails console and also couldn't get it to work there:

$ PDFKit.new(File.new(Rails.root.join("app/views/student/downloadable_parental_consents/show.html.erb"))).to_pdf

Exit with code 1, due to unknown error.
Traceback (most recent call last):

But this simple command would work:

PDFKit.new("").to_pdf

And even after making downloadable_parental_consents/show.html.erb an empty file (to mimic the last command), it still wouldn't work. :shrug: