Merge pull request #421 from Irev-Dev/kurt/420
Fix subscriber name When signing up to newsletter
This commit was merged in pull request #421.
This commit is contained in:
@@ -2,8 +2,8 @@ import { useState } from 'react'
|
||||
import Dialog from '@material-ui/core/Dialog'
|
||||
import Tab from '@material-ui/core/Tab'
|
||||
import Tabs from '@material-ui/core/Tabs'
|
||||
import InputTextForm from 'src/components/InputTextForm'
|
||||
import OutBound from 'src/components/OutBound'
|
||||
import InputTextForm from 'src/components/InputTextForm/InputTextForm'
|
||||
import OutBound from 'src/components/OutBound/OutBound'
|
||||
import { Form, Submit } from '@redwoodjs/forms'
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
import { toast } from '@redwoodjs/web/toast'
|
||||
@@ -25,7 +25,7 @@ const LoginModal = ({ open, onClose, shouldStartWithSignup = false }) => {
|
||||
try {
|
||||
setError('')
|
||||
if (checkBox) {
|
||||
subscribe({ email, addMessage: (msg) => toast.error(msg) })
|
||||
subscribe({ email, addMessage: (msg) => toast.error(msg), name })
|
||||
}
|
||||
await signUp({
|
||||
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
|
||||
const path = window.location.hostname + window.location.pathname
|
||||
try {
|
||||
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) {
|
||||
setTimeout(() => {
|
||||
Reference in New Issue
Block a user