-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba1e318
commit ae67689
Showing
7 changed files
with
53 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,3 +143,4 @@ uploads/* | |
.idea | ||
|
||
.DS_Store | ||
volume/cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
subject: "${organisation} submitted a ${dataset} endpoint" | ||
|
||
body: | | ||
Hello data management team, | ||
A new endpoint has been submitted with these details and is ready to check: | ||
Name: ${name} | ||
Organisation: ${organisation} | ||
Email: ${email} | ||
Endpoint URL: ${endpoint} | ||
Documentation URL: ${documentationUrl} | ||
Dataset Type: ${dataset} | ||
I confirm this dataset is provided under the Open Government Licence |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import PageController from './pageController.js' | ||
import yaml from 'js-yaml'; | ||
import fs from 'fs'; | ||
|
||
const templateFile = 'src/assets/emailTemplates/newEndpoint.yml' | ||
|
||
const templateContent = fs.readFileSync(templateFile, 'utf8'); | ||
const template = yaml.load(templateContent); | ||
|
||
class confirmationController extends PageController { | ||
locals(req, res, next) { | ||
const name = req.sessionModel.get('name') | ||
const email = req.sessionModel.get('email') | ||
const organisation = req.sessionModel.get('lpa') | ||
const dataset = req.sessionModel.get('dataset') | ||
const documentationUrl = req.sessionModel.get('documentation-url') | ||
const endpoint = req.sessionModel.get('endpoint-url') | ||
|
||
const recipient = '[email protected]' | ||
const templateVars = { name, organisation, email, endpoint, documentationUrl, dataset }; | ||
const subject = template.subject.replace(/\${(.*?)}/g, (match, key) => templateVars[key]); | ||
const body = template.body.replace(/\${(.*?)}/g, (match, key) => templateVars[key]); | ||
|
||
req.form.options.mailTo = `mailto:${recipient}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}` | ||
|
||
super.locals(req, res, next) | ||
} | ||
} | ||
|
||
export default confirmationController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ | |
|
||
## What happens next | ||
|
||
We need you to send an email to [[email protected]]({{options.mailTo}}). | ||
|
||
you can do that by clicking [this link]({{options.mailTo}}) | ||
|
||
We will process your submission and add your dataset to the [planning data platform](https://www.planning.data.gov.uk/). | ||
|
||
Your dataset should appear on the platform within 5 working days. | ||
|