Skip to content

Commit

Permalink
Add email link to request response
Browse files Browse the repository at this point in the history
  • Loading branch information
tewson committed Apr 9, 2024
1 parent 848d8f5 commit 748396d
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/pages/candidates/[candidate].astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export async function getStaticPaths() {
return candidates.map((candidateRecord) => {
const candidateFullName = getStringFieldValue(candidateRecord, "Full name");
const candidateEmail = getOptionalStringFieldValue(
candidateRecord,
"Email"
);
const candidatePartyName = getLookupFieldValue(
candidateRecord,
"Party name"
Expand Down Expand Up @@ -82,6 +86,7 @@ export async function getStaticPaths() {
},
props: {
candidateFullName,
candidateEmail,
candidatePartyName,
candidateAreaName,
candidateAreaLocalAuthorityName,
Expand All @@ -95,6 +100,7 @@ export async function getStaticPaths() {
const {
candidateFullName,
candidateEmail,
candidatePartyName,
candidateAreaName,
candidateAreaLocalAuthorityName,
Expand Down Expand Up @@ -136,11 +142,21 @@ const {
</>
))
) : (
<p>
If you're a voter in this candidate's area and you'd like them to
answer these questions, please email them and tell them this:
&lt;[email protected]&gt;.
</p>
<>
<p class="mb-4">
{candidateFullName} hasn't yet responded to our questionnaire. If{" "}
{candidateAreaName} is your local electoral area, why not send them
an email reminding them to submit their responses?
</p>
<p>
<a
class="underline"
href={`mailto:${candidateEmail}[email protected]&subject=Dublin Inquirer questionnaire&body=I am a voter in ${candidateAreaName} and I am interested in your responses to the questions on Dublin Inquirer's local election voter guide.`}
>
Email {candidateFullName}
</a>
</p>
</>
)
}
</main>
Expand Down

0 comments on commit 748396d

Please sign in to comment.