From f6d11dd43da7825b3e67178221631b7e928f1fb9 Mon Sep 17 00:00:00 2001 From: Shannon Clarke Date: Tue, 16 Dec 2025 20:31:33 -0500 Subject: [PATCH 1/2] feat: add exit survey form schema --- schemas/exit-survey.json | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 schemas/exit-survey.json diff --git a/schemas/exit-survey.json b/schemas/exit-survey.json new file mode 100644 index 0000000..87bfc5b --- /dev/null +++ b/schemas/exit-survey.json @@ -0,0 +1,65 @@ +{ + "id": "exit-survey", + "name": "Exit Survey", + "description": "Provide feedback on your experience", + "fields": [ + { + "name": "difficultyRating", + "type": "string", + "label": "How easy or difficult was it to complete this form?", + "required": true, + "validations": { + "regex": "^(very-easy|easy|neither|difficult|very-difficult)$", + "message": "Must select an option" + } + }, + { + "name": "clarityRating", + "type": "string", + "label": "How clear was the information provided?", + "required": true, + "validations": { + "regex": "^(very-clear|clear|neither|unclear|very-unclear)$", + "message": "Must select an option" + } + }, + { + "name": "technicalProblems", + "type": "string", + "label": "Did you experience any technical problems?", + "required": true, + "validations": { + "regex": "^(yes|no)$", + "message": "Must select an option" + } + }, + { + "name": "technicalProblemsDescription", + "type": "string", + "label": "Please briefly describe the problem you experienced", + "required": false, + "validations": { + "max": 100 + } + }, + { + "name": "areasForImprovement", + "type": "string", + "label": "What is one thing we could do to improve this form?", + "required": true, + "validations": { + "max": 500 + } + } + ], + "processors": [ + { + "type": "email", + "config": { + "to": "{{db:exit-survey:admin_email}}", + "subject": "New Exit Survey Submission - {{formData.applicant.firstName}} {{formData.applicant.lastName}}", + "template": "exit-survey" + } + } + ] +} From e26af1b1790b50702de5e6a84a9d1bd8f32169ca Mon Sep 17 00:00:00 2001 From: EthicalRalph Date: Thu, 18 Dec 2025 21:54:00 +0100 Subject: [PATCH 2/2] feat: implement exit survey email template and update survey submission subject --- schemas/exit-survey.json | 126 +++++++++++++-------------- src/email/templates/exit-survey.hbs | 128 ++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 63 deletions(-) create mode 100644 src/email/templates/exit-survey.hbs diff --git a/schemas/exit-survey.json b/schemas/exit-survey.json index 87bfc5b..7134886 100644 --- a/schemas/exit-survey.json +++ b/schemas/exit-survey.json @@ -1,65 +1,65 @@ { - "id": "exit-survey", - "name": "Exit Survey", - "description": "Provide feedback on your experience", - "fields": [ - { - "name": "difficultyRating", - "type": "string", - "label": "How easy or difficult was it to complete this form?", - "required": true, - "validations": { - "regex": "^(very-easy|easy|neither|difficult|very-difficult)$", - "message": "Must select an option" - } - }, - { - "name": "clarityRating", - "type": "string", - "label": "How clear was the information provided?", - "required": true, - "validations": { - "regex": "^(very-clear|clear|neither|unclear|very-unclear)$", - "message": "Must select an option" - } - }, - { - "name": "technicalProblems", - "type": "string", - "label": "Did you experience any technical problems?", - "required": true, - "validations": { - "regex": "^(yes|no)$", - "message": "Must select an option" - } - }, - { - "name": "technicalProblemsDescription", - "type": "string", - "label": "Please briefly describe the problem you experienced", - "required": false, - "validations": { - "max": 100 - } - }, - { - "name": "areasForImprovement", - "type": "string", - "label": "What is one thing we could do to improve this form?", - "required": true, - "validations": { - "max": 500 - } - } - ], - "processors": [ - { - "type": "email", - "config": { - "to": "{{db:exit-survey:admin_email}}", - "subject": "New Exit Survey Submission - {{formData.applicant.firstName}} {{formData.applicant.lastName}}", - "template": "exit-survey" - } - } - ] + "id": "exit-survey", + "name": "Exit Survey", + "description": "Provide feedback on your experience", + "fields": [ + { + "name": "difficultyRating", + "type": "string", + "label": "How easy or difficult was it to complete this form?", + "required": true, + "validations": { + "regex": "^(very-easy|easy|neither|difficult|very-difficult)$", + "message": "Must select an option" + } + }, + { + "name": "clarityRating", + "type": "string", + "label": "How clear was the information provided?", + "required": true, + "validations": { + "regex": "^(very-clear|clear|neither|unclear|very-unclear)$", + "message": "Must select an option" + } + }, + { + "name": "technicalProblems", + "type": "string", + "label": "Did you experience any technical problems?", + "required": true, + "validations": { + "regex": "^(yes|no)$", + "message": "Must select an option" + } + }, + { + "name": "technicalProblemsDescription", + "type": "string", + "label": "Please briefly describe the problem you experienced", + "required": false, + "validations": { + "max": 100 + } + }, + { + "name": "areasForImprovement", + "type": "string", + "label": "What is one thing we could do to improve this form?", + "required": true, + "validations": { + "max": 500 + } + } + ], + "processors": [ + { + "type": "email", + "config": { + "to": "{{db:exit-survey:admin_email}}", + "subject": "New Exit Survey Submission - {{formData.difficultyRating}} Experience", + "template": "exit-survey" + } + } + ] } diff --git a/src/email/templates/exit-survey.hbs b/src/email/templates/exit-survey.hbs new file mode 100644 index 0000000..3f569ee --- /dev/null +++ b/src/email/templates/exit-survey.hbs @@ -0,0 +1,128 @@ + + + + + + +
+

📋 New Exit Survey Submission

+ + + + +
+

Survey Responses

+ + + + + + + + + + + + + + + {{#if technicalProblemsDescription}} + + + + + {{/if}} + +
Difficulty Rating: + {{#if (eq difficultyRating 'very-easy')}} + Very Easy + {{else if (eq difficultyRating 'easy')}} + Easy + {{else if (eq difficultyRating 'neither')}} + Neither Easy nor + Difficult + {{else if (eq difficultyRating 'difficult')}} + Difficult + {{else if (eq difficultyRating 'very-difficult')}} + Very + Difficult + {{else}} + {{difficultyRating}} + {{/if}} +
Clarity Rating: + {{#if (eq clarityRating 'very-clear')}} + Very Clear + {{else if (eq clarityRating 'clear')}} + Clear + {{else if (eq clarityRating 'neither')}} + Neither Clear nor + Unclear + {{else if (eq clarityRating 'unclear')}} + Unclear + {{else if (eq clarityRating 'very-unclear')}} + Very Unclear + {{else}} + {{clarityRating}} + {{/if}} +
Technical Problems: + {{#if (eq technicalProblems 'yes')}} + Yes + {{else if (eq technicalProblems 'no')}} + No + {{else}} + {{technicalProblems}} + {{/if}} +
Problem Description:{{technicalProblemsDescription}}
+
+ + +
+

Suggested Improvements

+
+ What could be improved: +

{{areasForImprovement}}

+
+
+ + + +
+ + \ No newline at end of file