Nuenni
December 4, 2024, 7:11pm
1
Hi there,
I use N8N with an http post request node and this code:
{
"members": [
{
"email": "iflubberdopler12@byom.de",
"labels": ["Community", "Warteliste"],
"email_settings": {"send_email": true, "email_type": "subscribe"}
}
]
}
Member Creation
Works fine in Ghost i dont get any errors here is a pic:
The Problem
The new User dont get an “Subscription eMail” to confirm.
Alternative Test in Zapier
In Zapier it works fine with the same settings:
here is the email i mean
Conclusion
What i am doing wrong in my JSON-Code to send this email to new members ?
Thx a lot for support!
You don’t pass options as part of the body. Pass it as a query string. Like this:
let result = await fetch(GHOST_API_URL + '/ghost/api/admin/members/?send_email=true', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Ghost ' + token
},
body: JSON.stringify({
members: [{
...data,
}]
})
})
1 Like
Nuenni
December 4, 2024, 10:29pm
3
Hey Cathy,
Thanks, that worked almost perfectly. The “Please confirm” email is now incoming:
The String Query Parameter
Ghost in a hurry ?
But the Ghost Member is directly created, its seems that Ghost doesn’t wait to Confirm the Subscription for creating the member. When i register over the website the systems waits the opt-in confirmation.
Do i need to change anything in the code, or is it the way ghost works :) ?
Oh, wrong endpoint then. You need send-magic-link.
Details:
Nuenni
December 4, 2024, 10:44pm
5
Thxs for your documentation, with the magic link endpoint.
Just to clarify:
When i use the magic-link endpoint. The user will be only created as Member when he click on the magic link and not via the api correct?
(With the normal API it creates a user,independly which email he gets)
Correct.
You may also need an integrity token. Updated the link above to include it.
(Hard to keep all the posts up to date at all times! Especially for changes that aren’t super obvious.)
1 Like