Skip to content

Commit 6ba7966

Browse files
authored
Merge pull request #194 from linuanyang/main
fix: change buttondown api params email to email_address
2 parents 852b75a + e29e776 commit 6ba7966

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/fifty-comics-approve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pliny': patch
3+
---
4+
5+
change buttondown api params email to email_address

packages/pliny/src/newsletter/buttondown.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ export const buttondownSubscribe = async (email: string) => {
22
const API_KEY = process.env.BUTTONDOWN_API_KEY
33
const API_URL = 'https://api.buttondown.email/v1/'
44
const buttondownRoute = `${API_URL}subscribers`
5+
6+
const data = { email_address: email }
7+
58
const response = await fetch(buttondownRoute, {
6-
body: JSON.stringify({
7-
email,
8-
}),
9+
body: JSON.stringify(data),
910
headers: {
1011
Authorization: `Token ${API_KEY}`,
1112
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)