newsletter fix
This commit is contained in:
parent
9f3fe229d5
commit
065630decb
|
@ -10,7 +10,7 @@ export default async (req, res) => {
|
|||
const { email } = req.body
|
||||
|
||||
try {
|
||||
const response = await mg.lists.members.createMember('welcome@discours.io', {
|
||||
const response = await mg.lists.members.createMember('newsletter@discours.io', {
|
||||
address: email,
|
||||
subscribed: true,
|
||||
upsert: 'yes'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { createSignal } from 'solid-js'
|
||||
import { createSignal, Show } from 'solid-js'
|
||||
import styles from './Subscribe.module.scss'
|
||||
|
||||
import { clsx } from 'clsx'
|
||||
|
@ -27,14 +27,15 @@ export default () => {
|
|||
|
||||
return (
|
||||
<div class={styles.subscribeForm}>
|
||||
<label for="email">{title()}</label>
|
||||
<input type="email" name="email" ref={emailElement} placeholder={t('Fill email')} />
|
||||
<button
|
||||
class={clsx(styles.button, 'button--light')}
|
||||
onClick={() => emailElement?.value && subscribe()}
|
||||
>
|
||||
{t('Subscribe')}
|
||||
</button>
|
||||
<Show when={!title()} fallback={title()}>
|
||||
<input type="email" name="email" ref={emailElement} placeholder={t('Fill email')} />
|
||||
<button
|
||||
class={clsx(styles.button, 'button--light')}
|
||||
onClick={() => emailElement?.value && subscribe()}
|
||||
>
|
||||
{t('Subscribe')}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user