issue-129 Update signin/up ui-ux
Getting rid of the netlify widgit and rolling our own, gives us the flexibility to also add the username into the signup process as well as allow the user to opt into the newsletter at the same time. Auth is still netlify, via their "gotrue", we're just handling the more of it.
This commit is contained in:
15
web/src/helpers/subscribe.js
Normal file
15
web/src/helpers/subscribe.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export const subscribe = ({ email, addMessage }) => {
|
||||
// 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`
|
||||
)
|
||||
} catch (e) {
|
||||
setTimeout(() => {
|
||||
addMessage('Problem subscribing to newsletter', {
|
||||
classes: 'bg-red-300 text-red-900',
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user