From 455f244ec582e220870f545eb9a34d58af72e356 Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Thu, 13 Dec 2018 13:56:25 +0100 Subject: Hook up newsletter form to api --- packages/website/ts/@next/components/newsletter_form.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/website/ts/@next/components') diff --git a/packages/website/ts/@next/components/newsletter_form.tsx b/packages/website/ts/@next/components/newsletter_form.tsx index 3277f7f2e..455e7b54c 100644 --- a/packages/website/ts/@next/components/newsletter_form.tsx +++ b/packages/website/ts/@next/components/newsletter_form.tsx @@ -58,16 +58,18 @@ export class NewsletterForm extends React.Component { e.preventDefault(); const email = this.emailInput.current.value; + const referrer = "https://0xproject.com/"; this.setState({ isSubmitted: true }); try { - const response = await fetch('/email', { + const response = await fetch('https://website-api.0xproject.com/newsletter_subscriber/substack', { method: 'post', + mode: 'cors', headers: { 'content-type': 'application/json; charset=utf-8', }, - body: JSON.stringify({ email }), + body: JSON.stringify({ email, referrer }), }); const json = await response.json(); -- cgit v1.2.3