Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions schemas/exit-survey.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
128 changes: 128 additions & 0 deletions src/email/templates/exit-survey.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<html>
<head>
<meta charset='utf-8' />
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #333;
margin: 0; padding: 0; } .container { max-width: 800px; margin: 0 auto;
padding: 20px; } h1 { color: #003087; border-bottom: 3px solid #FFB71B;
padding-bottom: 10px; margin-bottom: 20px; font-size: 28px; } h2 { color:
#003087; font-size: 20px; margin-top: 30px; margin-bottom: 15px; } table {
width: 100%; border-collapse: collapse; margin-bottom: 20px; } td {
padding: 12px; border-bottom: 1px solid #eee; vertical-align: top; }
td:first-child { background-color: #f5f5f5; font-weight: bold; width: 40%;
} .section { margin-top: 20px; } .footer { margin-top: 30px; padding-top:
20px; border-top: 1px solid #ccc; color: #666; font-size: 12px;
text-align: left; } .submitted-info { margin-bottom: 20px; font-size:
16px; background-color: #f0f8ff; padding: 15px; border-left: 4px solid
#003087; } .rating-badge { display: inline-block; padding: 6px 12px;
border-radius: 4px; font-weight: bold; font-size: 14px; }
.rating-very-easy, .rating-very-clear { background-color: #d4edda; color:
#155724; } .rating-easy, .rating-clear { background-color: #d1ecf1; color:
#0c5460; } .rating-neither { background-color: #fff3cd; color: #856404; }
.rating-difficult, .rating-unclear { background-color: #f8d7da; color:
#721c24; } .rating-very-difficult, .rating-very-unclear {
background-color: #f5c6cb; color: #721c24; } .rating-yes {
background-color: #f8d7da; color: #721c24; } .rating-no {
background-color: #d4edda; color: #155724; } .improvement-box {
background-color: #fff9e6; border: 2px solid #ffc107; border-radius: 5px;
padding: 15px; margin: 10px 0; }
</style>
</head>
<body>
<div class='container'>
<h1>📋 New Exit Survey Submission</h1>

<div class='submitted-info'>
<strong>Survey Submitted:</strong>
{{processedAt}}
</div>

<!-- Survey Responses -->
<section class='section'>
<h2>Survey Responses</h2>
<table>
<tbody>
<tr>
<td>Difficulty Rating:</td>
<td>
{{#if (eq difficultyRating 'very-easy')}}
<span class='rating-badge rating-very-easy'>Very Easy</span>
{{else if (eq difficultyRating 'easy')}}
<span class='rating-badge rating-easy'>Easy</span>
{{else if (eq difficultyRating 'neither')}}
<span class='rating-badge rating-neither'>Neither Easy nor
Difficult</span>
{{else if (eq difficultyRating 'difficult')}}
<span class='rating-badge rating-difficult'>Difficult</span>
{{else if (eq difficultyRating 'very-difficult')}}
<span class='rating-badge rating-very-difficult'>Very
Difficult</span>
{{else}}
{{difficultyRating}}
{{/if}}
</td>
</tr>
<tr>
<td>Clarity Rating:</td>
<td>
{{#if (eq clarityRating 'very-clear')}}
<span class='rating-badge rating-very-clear'>Very Clear</span>
{{else if (eq clarityRating 'clear')}}
<span class='rating-badge rating-clear'>Clear</span>
{{else if (eq clarityRating 'neither')}}
<span class='rating-badge rating-neither'>Neither Clear nor
Unclear</span>
{{else if (eq clarityRating 'unclear')}}
<span class='rating-badge rating-unclear'>Unclear</span>
{{else if (eq clarityRating 'very-unclear')}}
<span class='rating-badge rating-very-unclear'>Very Unclear</span>
{{else}}
{{clarityRating}}
{{/if}}
</td>
</tr>
<tr>
<td>Technical Problems:</td>
<td>
{{#if (eq technicalProblems 'yes')}}
<span class='rating-badge rating-yes'>Yes</span>
{{else if (eq technicalProblems 'no')}}
<span class='rating-badge rating-no'>No</span>
{{else}}
{{technicalProblems}}
{{/if}}
</td>
</tr>
{{#if technicalProblemsDescription}}
<tr>
<td>Problem Description:</td>
<td>{{technicalProblemsDescription}}</td>
</tr>
{{/if}}
</tbody>
</table>
</section>

<!-- Areas for Improvement -->
<section class='section'>
<h2>Suggested Improvements</h2>
<div class='improvement-box'>
<strong>What could be improved:</strong>
<p style='margin: 10px 0 0 0;'>{{areasForImprovement}}</p>
</div>
</section>

<!-- Footer -->
<div class='footer'>
<p>
This is an automated email from the Government of Barbados Forms
Processing System.<br />
Exit surveys help us improve our services and user experience.<br />
Please review this feedback and consider implementing improvements
where appropriate.
</p>
</div>
</div>
</body>
</html>