Replace welcome image in email templates

This commit is contained in:
roschaefer 2020-06-15 14:54:03 +02:00
parent 77b031083e
commit dd09dfa721
10 changed files with 24 additions and 16 deletions

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 ${CONFIG.EMAIL_SUPPORT}`,
error: `Something went terribly wrong. Please visit ${CONFIG.SUPPORT_URL}`,
})
} finally {
session.close()

View File

@ -1,4 +1,6 @@
import dotenv from 'dotenv'
import links from './links.js'
if (require.resolve) {
// are we in a nodejs environment?
try {
@ -37,7 +39,6 @@ const {
REDIS_PORT,
REDIS_PASSWORD,
EMAIL_DEFAULT_SENDER,
EMAIL_SUPPORT,
} = env
export const requiredConfigs = {
@ -92,7 +93,7 @@ export const s3Configs = {
export const customConfigs = {
EMAIL_DEFAULT_SENDER,
EMAIL_SUPPORT,
SUPPORT_URL: links.SUPPORT,
}
export default {

View File

@ -0,0 +1,6 @@
export default {
ORGANIZATION: 'https://human-connection.org/',
DONATE: 'https://human-connection.org/spenden/',
FAQ: 'https://faq.human-connection.org/',
SUPPORT: 'https://human-connection.org/support'
}

View File

@ -4,7 +4,8 @@ import CONFIG from '../../config'
import * as templates from './templates'
const from = CONFIG.EMAIL_DEFAULT_SENDER
const supportUrl = 'https://human-connection.org/en/contact'
const supportUrl = CONFIG.SUPPORT_URL
const welcomeImageUrl = new URL(`/img/custom/welcome.svg`, CONFIG.CLIENT_URI)
export const signupTemplate = ({ email, nonce }) => {
const subject = 'Willkommen, Bienvenue, Welcome to Human Connection!'
@ -18,7 +19,7 @@ export const signupTemplate = ({ email, nonce }) => {
subject,
html: mustache.render(
templates.layout,
{ actionUrl, nonce, supportUrl, subject },
{ actionUrl, nonce, supportUrl, welcomeImageUrl, subject },
{ content: templates.signup },
),
}
@ -36,7 +37,7 @@ export const emailVerificationTemplate = ({ email, nonce, name }) => {
subject,
html: mustache.render(
templates.layout,
{ actionUrl, name, nonce, supportUrl, subject },
{ actionUrl, name, nonce, supportUrl, welcomeImageUrl, subject },
{ content: templates.emailVerification },
),
}
@ -54,7 +55,7 @@ export const resetPasswordTemplate = ({ email, nonce, name }) => {
subject,
html: mustache.render(
templates.layout,
{ actionUrl, name, nonce, supportUrl, subject },
{ actionUrl, name, nonce, supportUrl, welcomeImageUrl, subject },
{ content: templates.passwordReset },
),
}
@ -70,7 +71,7 @@ export const wrongAccountTemplate = ({ email }) => {
subject,
html: mustache.render(
templates.layout,
{ actionUrl, supportUrl },
{ actionUrl, supportUrl, welcomeImageUrl },
{ content: templates.wrongAccount },
),
}

View File

@ -6,7 +6,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">
@ -104,7 +104,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">

View File

@ -6,7 +6,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">
@ -104,7 +104,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">

View File

@ -6,7 +6,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">
@ -117,7 +117,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">

View File

@ -6,7 +6,7 @@
<tr>
<td style="background-color: #ffffff;">
<img
src="https://firebasestorage.googleapis.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LcGvGRsW6DrZn7FWRzF%2F-LcGv6EiVcsjYLfQ_2YE%2F-LcGv8UtmAWc61fxGveg%2Flets_get_together.png?generation=1555078880410873&alt=media"
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Human Connection community logo" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
class="g-img">

View File

@ -45,7 +45,6 @@ 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

View File

@ -2,4 +2,5 @@ export default {
ORGANIZATION: 'https://human-connection.org/',
DONATE: 'https://human-connection.org/spenden/',
FAQ: 'https://faq.human-connection.org/',
SUPPORT: 'https://human-connection.org/support'
}