Skip to content

Commit

Permalink
Prepopulate the email #76
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Haarhoff committed Nov 16, 2024
1 parent b5092e6 commit 22fc9b0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/queries/raise-issue/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@ type ViewModel = {
};

const infoSystemsGroupEmailAddress = safe('[email protected]');
const mailSubject = encodeURIComponent('ISSUE with member records');
const body = (memberNumber: ViewModel['memberNumber']) =>
encodeURIComponent(`Hi,
My member number is ${memberNumber}.
I have the following issue with my records:
...
`);
const mailtoLink = (memberNumber: ViewModel['memberNumber']) =>
safe(
`mailto:${infoSystemsGroupEmailAddress}?subject=${mailSubject}&body=${body(memberNumber)}`
);

export const render = (viewModel: ViewModel) => html`
<div class="stack">
<h1>Raise an issue</h1>
<h2>If your records are wrong</h2>
<p>
Send the app and records team an email:
<a href="mailto:${infoSystemsGroupEmailAddress}"
<a href="${mailtoLink(viewModel.memberNumber)}"
>${infoSystemsGroupEmailAddress}</a
>
</p>
Expand Down

0 comments on commit 22fc9b0

Please sign in to comment.