Retrieve a mailing list member by address. See the docs here
1
type Mailgun = {
2
api_key: string;
3
};
4
5
export async function main(
6
resource: Mailgun,
7
data: {
8
listAddress: string;
9
memberAddress: string;
10
}
11
) {
12
return (
13
await fetch(
14
`https://api.mailgun.net/v3/lists/${data.listAddress}/members/${data.memberAddress}`,
15
{
16
method: "GET",
17
headers: {
18
Authorization:
19
"Basic " +
20
Buffer.from(`api:${resource.api_key}`).toString("base64"),
21
},
22
23
)
24
).json();
25
26