diff --git a/schemas/exit-survey.json b/schemas/exit-survey.json new file mode 100644 index 0000000..7134886 --- /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.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 Submitted: + {{processedAt}} +
+ + +
+

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