@@ -2,8 +2,8 @@ import { useState } from 'react'
|
|||||||
import Dialog from '@material-ui/core/Dialog'
|
import Dialog from '@material-ui/core/Dialog'
|
||||||
import Tab from '@material-ui/core/Tab'
|
import Tab from '@material-ui/core/Tab'
|
||||||
import Tabs from '@material-ui/core/Tabs'
|
import Tabs from '@material-ui/core/Tabs'
|
||||||
import InputTextForm from 'src/components/InputTextForm'
|
import InputTextForm from 'src/components/InputTextForm/InputTextForm'
|
||||||
import OutBound from 'src/components/OutBound'
|
import OutBound from 'src/components/OutBound/OutBound'
|
||||||
import { Form, Submit } from '@redwoodjs/forms'
|
import { Form, Submit } from '@redwoodjs/forms'
|
||||||
import { useAuth } from '@redwoodjs/auth'
|
import { useAuth } from '@redwoodjs/auth'
|
||||||
import { toast } from '@redwoodjs/web/toast'
|
import { toast } from '@redwoodjs/web/toast'
|
||||||
@@ -25,7 +25,7 @@ const LoginModal = ({ open, onClose, shouldStartWithSignup = false }) => {
|
|||||||
try {
|
try {
|
||||||
setError('')
|
setError('')
|
||||||
if (checkBox) {
|
if (checkBox) {
|
||||||
subscribe({ email, addMessage: (msg) => toast.error(msg) })
|
subscribe({ email, addMessage: (msg) => toast.error(msg), name })
|
||||||
}
|
}
|
||||||
await signUp({
|
await signUp({
|
||||||
email,
|
email,
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
export const subscribe = ({ email, addMessage }) => {
|
export const subscribe = ({
|
||||||
|
email,
|
||||||
|
addMessage,
|
||||||
|
name,
|
||||||
|
}: {
|
||||||
|
email: string
|
||||||
|
addMessage: Function
|
||||||
|
name: string
|
||||||
|
}) => {
|
||||||
// subscribe to mailchimp newsletter
|
// subscribe to mailchimp newsletter
|
||||||
const path = window.location.hostname + window.location.pathname
|
const path = window.location.hostname + window.location.pathname
|
||||||
try {
|
try {
|
||||||
fetch(
|
fetch(
|
||||||
`https://kurthutten.us10.list-manage.com/subscribe/post-json?u=cbd8888e924bdd99d06c14fa5&id=6a765a8b3d&EMAIL=${email}&FNAME=Kurt&PATHNAME=${path}&c=__jp0`
|
`https://kurthutten.us10.list-manage.com/subscribe/post-json?u=cbd8888e924bdd99d06c14fa5&id=6a765a8b3d&EMAIL=${email}&FNAME=${name}&PATHNAME=${path}&c=__jp0`
|
||||||
)
|
)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Reference in New Issue
Block a user