Skip to content

Commit

Permalink
fix: use email env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Naomi Aro committed Apr 22, 2021
1 parent 9dfd397 commit cfa9d77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
},
publicRuntimeConfig: {
NO_MATHJAX: process.env.NO_MATHJAX,
ADMIN_EMAIL: process.env.ADMIN_EMAIL,
SUPPORT_EMAIL: process.env.SUPPORT_EMAIL,
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
SITEWIDE_NOTICE: process.env.SITEWIDE_NOTICE,
Expand Down
14 changes: 10 additions & 4 deletions app/pages/resources/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import {Container, Alert} from 'react-bootstrap';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
import {graphql} from 'react-relay';
import getConfig from 'next/config';
import {CiipPageComponentProps} from 'next-env';
import {contactQueryResponse} from 'contactQuery.graphql';
import DefaultLayout from 'layouts/default-layout';
const getEmailShortForm = require('app/server/helpers/getEmailShortForm.js');

interface Props extends CiipPageComponentProps {
query: contactQueryResponse['query'];
Expand All @@ -26,6 +28,10 @@ class Contact extends Component<Props> {
render() {
const {query} = this.props;
const {session} = query || {};
const supportEmail = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
const adminEmail = getEmailShortForm(
getConfig()?.publicRuntimeConfig.ADMIN_EMAIL
);
return (
<DefaultLayout session={session} title="Contact Us">
<Container>
Expand All @@ -34,15 +40,15 @@ class Contact extends Component<Props> {
<span className="pl-2">
For help with your CIIP application, or questions about the
CleanBC Industrial Incentive Program, please email{' '}
<a href="mailto:GHGRegulator@gov.bc.ca?subject=Support Request (CIIP)">
GHGRegulator@gov.bc.ca
<a href={`mailto:${adminEmail}?subject=Support Request (CIIP)`}>
{adminEmail}
</a>
</span>
</Alert>
<p className="px-4 py-3">
To report a website error, contact the development team at{' '}
<a href="mailto:ggircs@gov.bc.ca?subject=Support Request (CIIP)">
ggircs@gov.bc.ca
<a href={`mailto:${supportEmail}?subject=Support Request (CIIP)`}>
{supportEmail}
</a>
.
</p>
Expand Down

0 comments on commit cfa9d77

Please sign in to comment.