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 @@ + +
+ + + + +| Difficulty Rating: | ++ {{#if (eq difficultyRating 'very-easy')}} + + {{else if (eq difficultyRating 'easy')}} + + {{else if (eq difficultyRating 'neither')}} + + {{else if (eq difficultyRating 'difficult')}} + + {{else if (eq difficultyRating 'very-difficult')}} + + {{else}} + {{difficultyRating}} + {{/if}} + | +
| Clarity Rating: | ++ {{#if (eq clarityRating 'very-clear')}} + + {{else if (eq clarityRating 'clear')}} + + {{else if (eq clarityRating 'neither')}} + + {{else if (eq clarityRating 'unclear')}} + + {{else if (eq clarityRating 'very-unclear')}} + + {{else}} + {{clarityRating}} + {{/if}} + | +
| Technical Problems: | ++ {{#if (eq technicalProblems 'yes')}} + + {{else if (eq technicalProblems 'no')}} + + {{else}} + {{technicalProblems}} + {{/if}} + | +
| Problem Description: | +{{technicalProblemsDescription}} | +
{{areasForImprovement}}
+