cds-snc / ircc-rescheduler

🙅🗓
https://vancouver.rescheduler-dev.cds-snc.ca/
MIT License
24 stars 7 forks source link

Update email templates to handle availability explanation #441

Closed timarney closed 6 years ago

timarney commented 6 years ago

With the addition of https://github.com/cds-snc/ircc-rescheduler/pull/438 the email templates need to handle either selected days or the availability explanation. This updates handles the new scenarios and is backwards compatible with the existing setup.

Testing

To test locally run update the cypress user fixture to your email address and run "validation-error.spec" (Full Run-through including validation errors). To test with an availability explanation add an explanation manually i.e.

options.formValues.availabilityExplanation = "Hey this works!"

if (
    typeof options.formValues.availabilityExplanation !== 'undefined' &&
    options.formValues.availabilityExplanation !== ''
  ) {
    renderAvailabilityExplanation(options)
  } else {
    renderSelectedDays(options)
  }

...

Sample user email:

screen shot 2018-09-12 at 1 25 48 pm