Skip to content

Commit

Permalink
Create donation services email variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Dec 13, 2024
1 parent 6613ebf commit 63d0daa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ const config: NextConfig = {
PRIVACY_POLICY_URL: process.env.PRIVACY_POLICY_URL,
TERMS_OF_USE_URL: process.env.TERMS_OF_USE_URL,
DD_ENV: process.env.DD_ENV ?? 'development',
SERVICE_SUPPORT_EMAIL: process.env.SERVICE_SUPPORT_EMAIL ?? '[email protected]',
DONATION_SERVICES_EMAIL:
process.env.DONATION_SERVICES_EMAIL ?? '[email protected]',
},
// Force .page prefix on page files (ex. index.page.tsx) so generated files can be included in /pages directory without Next.js throwing build errors
pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
query ContactSource($accountListId: ID!, $contactId: ID!) {
contact(accountListId: $accountListId, id: $contactId) {
id
name
source
addresses {
nodes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CircularProgress,
DialogActions,
DialogContent,
Link,
List,
ListItem,
ListItemIcon,
Expand Down Expand Up @@ -55,6 +56,7 @@ export const DeleteContactModal: React.FC<DeleteContactModalProps> = ({
skip: !open && !contactId,
});
const contactSources = data?.contact;
const contactName = data?.contact?.name;

const dataInfo: DataInfo = useMemo(() => {
if (!contactSources) {
Expand Down Expand Up @@ -136,7 +138,6 @@ export const DeleteContactModal: React.FC<DeleteContactModalProps> = ({
)}
</Typography>
<br />
<br />
<Typography variant="h6">{t('Data sources:')}</Typography>
<List dense={true}>
{!!dataInfo.contactSource && (
Expand Down Expand Up @@ -187,6 +188,21 @@ export const DeleteContactModal: React.FC<DeleteContactModalProps> = ({
</ListItem>
)}
</List>
<br />
<Typography>
<Link
href={`mailto:${
process.env.DONATION_SERVICES_EMAIL
}?subject=Request+contact+deletion&body=${encodeURIComponent(
`Dear Donation Services,\n\Please could you remove the following contacts: ${contactName} ` +
'\n\nThanks,\n\n',
)}`}
underline="hover"
sx={{ fontWeight: 'bold' }}
>
{t('Email Donation Services here')}
</Link>
</Typography>
</>
)}
</DialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ export const EditContactAddressModal: React.FC<
{emailData && (
<p>
<Link
href={`mailto:[email protected]?subject=Donor+address+change&body=${encodeURIComponent(
href={`mailto:${
process.env.DONATION_SERVICES_EMAIL
}?subject=Donor+address+change&body=${encodeURIComponent(
generateEmailBody(emailData, address),
)}`}
underline="hover"
Expand Down

0 comments on commit 63d0daa

Please sign in to comment.