From 40c96f6e762a910f7f943c3b00c3888d3fdc8361 Mon Sep 17 00:00:00 2001 From: Michael Peterson Date: Thu, 27 Jan 2022 12:20:04 -0500 Subject: [PATCH] Handbook redirects free emails (#249) * Redirect owners manual to handbook * Remove "read on aptible.com" text from handbook * Prevent free emails from signing up on paid landing pages --- gatsby-node.js | 3 +++ nginx.conf | 8 ++++++++ src/components/signup-form/SignupForm.js | 14 ++++++++++++-- src/pages/p/hipaa-free-credits.js | 1 + src/pages/p/hipaa-free-month.js | 1 + src/pages/p/hipaa-signup.js | 1 + 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 0931bd82..f4a5f369 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -392,6 +392,9 @@ exports.createPages = async ({ graphql, actions }) => { markdown = markdown.replace(/\]\(\/?(?!\/?images|https|\/?handbook)/g, '](/handbook/'); markdown = markdown.replace(/\.md/g, '/'); + // Remove "read on aptible.com" + markdown = markdown.replace(/\*\*\[Read on aptible.*/, ''); + // Convert markdown to HTML const html = markdownConverter.makeHtml(markdown); diff --git a/nginx.conf b/nginx.conf index 7f62642d..e1fe0dd1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -474,5 +474,13 @@ http { rewrite ^/documentation/enclave/reference/metrics/metric-drains/datadog.html$ https://deploy-docs.aptible.com/docs/datadog permanent; rewrite ^/documentation/deploy/reference/databases/credentials.html$ https://deploy-docs.aptible.com/docs/database-credentials permanent; rewrite ^/support/topics/enclave/how-to-run-scheduled-tasks/$ https://deploy-docs.aptible.com/docs/scheduled-tasks permanent; + + rewrite ^/owners-manual/?$ /handbook/ permanent; + rewrite ^/owners-manual/key-operating-processes/?$ /handbook/how-we-work/ permanent; + rewrite ^/owners-manual/communication-architecture-and-norms/?$ /handbook/how-we-work/communicating/ permanent; + rewrite ^/owners-manual/team-mission-market-fit/?$ /handbook/mission-strategy/ permanent; + rewrite ^/owners-manual/our-values/?$ /handbook/about-aptible/values/ permanent; + rewrite ^/owners-manual/communicating-and-connecting/?$ /handbook/about-aptible/connecting/ permanent; + rewrite ^/owners-manual/interviewing-with-aptible/?$ /handbook/recruiting-process/ permanent; } } diff --git a/src/components/signup-form/SignupForm.js b/src/components/signup-form/SignupForm.js index 107cea6b..43930ecf 100644 --- a/src/components/signup-form/SignupForm.js +++ b/src/components/signup-form/SignupForm.js @@ -7,9 +7,18 @@ import { event, identify, trackOnLinkedIn } from '../../lib/aptible/analytics'; import { querystring } from '../../lib/util'; const utmKeywords = ['utm_campaign', 'utm_medium', 'utm_source', 'utm_term']; +const freeEmailDomains = ['gmail.com', 'yahoo.com', 'hotmail.com']; -const validateEmail = email => { +const validateEmail = (email, allowPersonalEmails) => { if (!email) return { ok: false, message: 'email cannot be empty' }; + + if (!allowPersonalEmails) { + const emailTokens = email.split('@'); + if (emailTokens.length > 1 && freeEmailDomains.indexOf(emailTokens[1]) !== -1) { + return { ok: false, message: 'Please use your work email address' }; + } + } + return { ok: true, message: '' }; }; @@ -17,6 +26,7 @@ export const SignupForm = ({ id, btnText = 'Sign Up For Free', inputPlaceholder = 'Enter your email', + allowPersonalEmails = true, onSuccess = () => { }, }) => { const [submitted, setSubmitted] = useState(false); @@ -25,7 +35,7 @@ export const SignupForm = ({ const queryParams = queryString.parse(querystring()); const onSubmit = () => { - const result = validateEmail(email); + const result = validateEmail(email, allowPersonalEmails); if (!result.ok) { setError(result.message); return; diff --git a/src/pages/p/hipaa-free-credits.js b/src/pages/p/hipaa-free-credits.js index 93abb7aa..85e1ffa2 100644 --- a/src/pages/p/hipaa-free-credits.js +++ b/src/pages/p/hipaa-free-credits.js @@ -37,6 +37,7 @@ export default () => { id="Paid - HIPAA 499 Free Credits" btnText="Get $499 in Free Credits" inputPlaceholder="Enter your work email" + allowPersonalEmails={false} /> diff --git a/src/pages/p/hipaa-free-month.js b/src/pages/p/hipaa-free-month.js index 558ae119..3f86d5a7 100644 --- a/src/pages/p/hipaa-free-month.js +++ b/src/pages/p/hipaa-free-month.js @@ -37,6 +37,7 @@ export default () => { id="Paid - HIPAA First Month Free" btnText="Get Your 1st Month Free" inputPlaceholder="Enter your work email" + allowPersonalEmails={false} /> diff --git a/src/pages/p/hipaa-signup.js b/src/pages/p/hipaa-signup.js index b7e3f812..bd27131a 100644 --- a/src/pages/p/hipaa-signup.js +++ b/src/pages/p/hipaa-signup.js @@ -36,6 +36,7 @@ export default () => {