cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
31 stars 12 forks source link

When Freshdesk API fails, an email should be sent instead #3760

Open jprince-cds opened 4 weeks ago

jprince-cds commented 4 weeks ago

Description

When submitting the Contact Us form, the Freshdesk API is used to create the ticket.

If that API call fails, it should fallback to using Notify to send an email to Freshdesk instead. This was the behaviour before moving to the API, and I thought it was kept as a failover mechanism, which we realized MAY not be the case (to be investigated).

Steps to reproduce

  1. Go to the Forms Contact Us page.
  2. Submit a ticket with an email address that has an accent in it (e.g. testé@test.com)
  3. An error will get generated in the #forms-production-events channel.
  4. No email is received in Freshdesk, so no ticket gets created.

Details

See this Slack thread.

Expected behaviour

If the Freshdesk API fails for any reason, an email should be sent to assistance+forms-formulaires@cds-snc.ca instead via Notify to make sure the ticket is created in Freshdesk.

Additional context

As a side note, it's "normal" that the Freshdesk API fails when submitting an email address with an accented character, as it has the same behaviour when trying to do so front-end. One option could be to remove accents from email addresses before submitting to Freshdesk.