Skip to content

Commit

Permalink
Handbook redirects free emails (aptible#249)
Browse files Browse the repository at this point in the history
* Redirect owners manual to handbook

* Remove "read on aptible.com" text from handbook

* Prevent free emails from signing up on paid landing pages
  • Loading branch information
mjp authored Jan 27, 2022
1 parent b233d84 commit 40c96f6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 8 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
14 changes: 12 additions & 2 deletions src/components/signup-form/SignupForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@ 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: '' };
};

export const SignupForm = ({
id,
btnText = 'Sign Up For Free',
inputPlaceholder = 'Enter your email',
allowPersonalEmails = true,
onSuccess = () => { },
}) => {
const [submitted, setSubmitted] = useState(false);
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/pages/p/hipaa-free-credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
</div>

Expand Down
1 change: 1 addition & 0 deletions src/pages/p/hipaa-free-month.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
</div>

Expand Down
1 change: 1 addition & 0 deletions src/pages/p/hipaa-signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default () => {
<SignupForm
id="Paid - HIPAA Signup"
inputPlaceholder="Enter your work email"
allowPersonalEmails={false}
/>
</div>

Expand Down

0 comments on commit 40c96f6

Please sign in to comment.