Skip to content

Commit

Permalink
Legal text for demo site
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Oct 2, 2019
1 parent b61e387 commit e101fe0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const fromEmail =
'"PostGraphile Starter" <no-reply@examples.graphile.org>';
export const awsRegion = "us-east-1";
export const companyName = packageJson.name;
export const legalText = "<Insert legal email footer text here >";
export const emailLegalText =
// Envvar here so we can override on the demo website
process.env.LEGAL_TEXT || "<Insert legal email footer text here >";
6 changes: 5 additions & 1 deletion backend/src/worker/tasks/send_email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import mjml2html = require("mjml");
import * as html2text from "html-to-text";
import getTransport from "../transport";
import { readFile } from "../../fs";
import { companyName, legalText, fromEmail } from "../../config";
import {
companyName,
emailLegalText as legalText,
fromEmail,
} from "../../config";
import * as nodemailer from "nodemailer";
import chalk from "chalk";

Expand Down
6 changes: 6 additions & 0 deletions client/src/components/SharedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ function SharedLayout({ title, noPad = false, children }: SharedLayoutProps) {
<Text style={{ color: "#fff" }}>
Copyright &copy; {new Date().getFullYear()} {companyName}. All
rights reserved.
{process.env.T_AND_C_URL ? (
<span>
{" "}
<a href={process.env.T_AND_C_URL}>Terms and conditions</a>
</span>
) : null}
</Text>
<Text style={{ color: "#fff" }}>
Powered by{" "}
Expand Down
3 changes: 2 additions & 1 deletion client/src/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const compose = require("lodash/flowRight");

const { ROOT_DOMAIN, ROOT_URL } = process.env;
const { ROOT_DOMAIN, ROOT_URL, T_AND_C_URL } = process.env;
if (!ROOT_DOMAIN) {
throw new Error("ROOT_DOMAIN is a required envvar");
}
Expand Down Expand Up @@ -63,6 +63,7 @@ if (!ROOT_URL) {
new webpack.DefinePlugin({
"process.env.ROOT_DOMAIN": JSON.stringify(ROOT_DOMAIN),
"process.env.ROOT_URL": JSON.stringify(ROOT_URL),
"process.env.T_AND_C_URL": JSON.stringify(T_AND_C_URL || null),
}),
],
externals: [
Expand Down

0 comments on commit e101fe0

Please sign in to comment.