Hello! Thank you for taking the time to contribute to the HMRC Multichannel Digital Tax Platform (MDTP).
Every service or library on the MDTP is owned by a single team, in order to ensure no central repositories and/or teams constrain service delivery. Therefore this page describes the process for an individual or a team (the "Pull Requestor") to contribute to a repository (the "Repository") belonging to another team (the "Owning Team").
The contribution process is twofold:
- MDTP Guidelines: uniform guidelines applying to all repositories
- Repository Guidelines: contextual guidelines for a specific repository
It is the responsibility of both the Pull Requestor and Owning Team to follow these guidelines. If the Pull Requestor does not follow these guidelines, the Owning Team will reject the changes and may resist future Pull Requests.
It is important to remember that an Issue and a Pull Request are a placeholder for a conversation between the Pull Requestor and the Owning Team - people and interactions are important than processes and tools. The Pull Requestor should contact the Owning Team as soon as changes to the Repository are considered.
Once you've got your code changes done and a pull request created, it's time to get it pushed to production. Here's how:
- Run the preview mode application on your local development environment to ensure that your template renders properly
- Create a story for project "Digital Contact (DC)" in Jira with details of the pull request and what it's for
- Tag our scrum-master [~chris.selby] in the ticket, so we can get it prioritised for you
- Join Slack channel #team-digital-contact to ask about progress and/or ask questions
- Our QA's will contact you when the they have merged and deployed to QA so you can check your happy before we create a release ticket
- The Pull Requestor forks the Repository and makes the proposed changes - including new tests
- The Pull Requestor runs the Repository build locally and ensures all tests pass
- The Pull Requestor pushes their changes to their branch and raises a Pull Request against the Repository Issue
- The Owning Team informs the Pull Requestor:
- If the proposed change is unnecessary i.e. if the Repository already supports the desired outcome
- If the proposed change is undesirable e.g. rejected in the past from a different Pull Requestor
- If the proposed change can be reviewed and released into production in a timeline acceptable to both the Pull Requestor and the Owning Team
- The Owning Team reviews the Pull Request according to the following criteria:
- Can the changes be compiled and tested?
- Do the changes clearly indicate what they are trying to achieve?
- Are the changes aligned with our coding standards and our architectural approach?
- Are the changes compatible with other in-flight changes to the Repository?
- Do the changes introduce any new operational concerns e.g. performance, security?
- The Owning Team accepts or rejects the Pull Request
- If rejected, the Pull Requestor asks the Owning Team for feedback
- If accepted, the Owning Team merges the changes into the Repository and creates a new release
- The Pull Requestor and Owning Team discuss the optimal timing of pre-production and production releases
- The Owning Team release the changes into the relevant pre-production environment(s)
- The Pull Requestor and Owning Team validate the functional and operational impact in pre-production
- The Owning Team schedules a release of the changes into production
- The Pull Requestor and Owning Team validate the functional and operational impact in production
Please review these guidelines carefully before submitting new or changed hmrc email templates. They're here to protect HMRC's email from being marked as spam. If you don't, your pull request will probably be rejected.
If you'd like to add a template to the hmrc email template service, then:
- Create an XXXTemplates object in your new folder (under templates folder) e.g. DigitalContactTemplates
- If it doesn't already exist, create a new service identifier for your regime and add a new entry in templateGroups in the
TemplateLocator
scala file. - Create two templates for rendering your message :
.scala.txt
for the plain-text version.scala.html
for the html version
- Add a new
MessageTemplate
in your XXXTemplates object:
- If you just have a static template, you can use
MessageTemplate
.
- That's it!
One of our priorities is to make sure that the content of our emails doesn't lead the user to mark the message as spam. Here are some recommendations we came up with:
- This is the only part of the template that can be customized
- Title should clearly indicate the purpose of the email
- Salutation in the email: If the data is available in your service, please include a salutation at the beginning of the email (e.g. Dear Mr Rich The Cat ...)
- Avoid using acronyms: Throughout the message body please make sure you are using the full name (e.g. "Self Assessment" instead of "SA")
- Help the user understand why he's receiving the message: Information about why the user is receiving the email prevents marking the email as spam
- When closing a message, specify your identity within the HMRC organisation: It is important to clearly identify the sender. For example, "From HMRC Self Assessment". Please do not use "From HMRC" to end the message.
- Last but not least: Review the content for typos and grammar mistakes
For security reasons, it is currently HMRC policy that there are no links in emails, either in HTML or plain text, hyperlinked or not.
This is because there is no guaranteed way to stop an email reader, plain text or HTML based, from spotting a http://wherever.com/some-url link and turning it into a hyperlink - this has been researched extensively. The only permissible exception to this under policy is verification links, which are vital for proving a customer's address.
It is possible that you need to have your template available for testing but you haven't finalised the template content yet.
If that is the case we are willing to merge your Pull Request as long as there is a line right after the title (point 2 in the above image) that advises the user about it.
For example:
<h4>This is a test email only. Should you receive this email please ignore it</h4>
It's also really important to discuss with the DC team how many messages you expect to send, and when. We monitor the flow of email very carefully to ensure that deliverability of HMRC email is a good as it can be.
- That your template ID is descriptive and doesn't contain the words 'template' or 'id'.
- Good:
sa_alert_sa316_current_year
- Not so good:
sa_message_template_id
- Good:
- The names of your template
.scala.html
/.scala.txt
files match the template ID - Your template uses:
- the standard main template for
.html
- the standard footer for
.txt
- watch out for blank lines at the top of these too
- the standard main template for
- Your code is up to date with current
master
- That
sbt clean test it:test
passes happily - Your templates look right when rendered - use the preview mode
- Note: we will fail any PR with failing tests.