Skip to content

Commit afbfdc1

Browse files
committed
feat: support newsletterId for InputCTASection
1 parent 8a52a40 commit afbfdc1

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

packages/logos-docusaurus-theme/src/client/components/mdx/InputCTASection/InputCTASection.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type InputCTASectionProps = {
1212
linkProps?: Props
1313
formInput?: any[]
1414
buType?: buType
15+
newsletterId?: number
1516
}
1617

1718
type buType = 'codex' | 'waku' | 'nomos'
@@ -24,6 +25,7 @@ export const InputCTASection: React.FC<InputCTASectionProps & Props> = ({
2425
linkProps,
2526
formInput,
2627
buType,
28+
newsletterId = null,
2729
}) => {
2830
const [formState, setFormState] = React.useState({ email: '', name: '' })
2931
const [message, setMessage] = React.useState('')
@@ -49,11 +51,19 @@ export const InputCTASection: React.FC<InputCTASectionProps & Props> = ({
4951
body: JSON.stringify({
5052
jsonrpc: '2.0',
5153
method: 'call',
52-
params: {
53-
email: formState?.email,
54-
type: buType,
55-
subscription_type: 'email',
56-
},
54+
params:
55+
newsletterId == null
56+
? {
57+
email: formState?.email,
58+
type: buType,
59+
subscription_type: 'email',
60+
}
61+
: {
62+
email: formState?.email,
63+
type: buType,
64+
subscription_type: 'email',
65+
newsletterId: newsletterId,
66+
},
5767
}),
5868
},
5969
)

0 commit comments

Comments
 (0)