Parameterize emails in backend

This commit is contained in:
roschaefer 2020-06-05 16:49:32 +02:00
parent 063200bcb1
commit 16c7be1cc4
5 changed files with 15 additions and 2 deletions

View File

@ -24,3 +24,6 @@ AWS_SECRET_ACCESS_KEY=
AWS_ENDPOINT=
AWS_REGION=
AWS_BUCKET=
EMAIL_DEFAULT_SENDER="info@human-connection.org"
EMAIL_SUPPORT="support@human-connection.org"

View File

@ -45,7 +45,7 @@ export async function handler(req, res) {
} catch (error) {
debug(error)
return res.status(500).json({
error: 'Something went terribly wrong. Please contact support@human-connection.org',
error: `Something went terribly wrong. Please contact ${CONFIG.EMAIL_SUPPORT}`,
})
} finally {
session.close()

View File

@ -36,6 +36,8 @@ const {
REDIS_DOMAIN,
REDIS_PORT,
REDIS_PASSWORD,
EMAIL_DEFAULT_SENDER,
EMAIL_SUPPORT,
} = env
export const requiredConfigs = {
@ -88,6 +90,11 @@ export const s3Configs = {
S3_CONFIGURED,
}
export const customConfigs = {
EMAIL_DEFAULT_SENDER,
EMAIL_SUPPORT,
}
export default {
...requiredConfigs,
...smtpConfigs,
@ -97,4 +104,5 @@ export default {
...sentryConfigs,
...redisConfigs,
...s3Configs,
...customConfigs,
}

View File

@ -3,7 +3,7 @@ import CONFIG from '../../config'
import * as templates from './templates'
const from = '"Human Connection" <info@human-connection.org>'
const from = CONFIG.EMAIL_DEFAULT_SENDER
const supportUrl = 'https://human-connection.org/en/contact'
export const signupTemplate = ({ email, nonce }) => {

View File

@ -45,6 +45,8 @@ services:
- MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ
- PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78
- "DEBUG=${DEBUG}"
- EMAIL_SUPPORT=support@human-connection.org
- EMAIL_DEFAULT_SENDER=info@human-connection.org
neo4j:
image: schoolsinmotion/neo4j:latest
build: