When someone fills in the subscription form on the blog and receives the email with a button and a verification link it happens that the button link and the direct link are different.
The button link does not work, while the other one does.
Can reproduce this. I will take a look if I can fix it.
@gargol From what I saw in codebase, we get a POST request at /ghost/api/canary/members/send-magic-link/ with some data which includes the type of email to be sent. In this case, a signup email.
Here is the trigger for sending the link: https://github.com/TryGhost/Ghost/blob/67b8fbf6cfbe1cc1e2fe097ca9ee34fca166f6bf/core/server/web/api/canary/members/app.js#L28
However, I couldn't trace the sendMagicLink function which I think calculates the url to be inserted and sends it here: https://github.com/TryGhost/Ghost/blob/67b8fbf6cfbe1cc1e2fe097ca9ee34fca166f6bf/core/server/services/members/api.js#L110
Can you give me a hint here?
Also, please correct me if I am wrong above.
Hey @lunaticmonk :wave: have missed your message somehow :sweat_smile: I believe the method for the ....middleware.sendMagicLink you are looking for is this one from Members monorepo - https://github.com/TryGhost/Members/blob/baa2c6a655d6c0e8edde4b289144e160f81d105f/packages/members-api/index.js#L151-L180
Hope this gives you enough direction to debug further into the issue :wink:
@ferranrego @gargol I took a look at this and found out that the url that we pass to the email template is used at two places, one in the Activate my account button and another one as a bare url. One of them is working fine(the bare one), the other one in @ferranrego 's case, upon clicking the button, goes to email.blog.vocdoni.io first. I have a guess, the problem may be there. @ferranrego can you check if there is any possibility of problem with your ghost configuration?
Also, in @ferranrego blog, the emailType that is being passed is signup and not subscribe but as showed below, the user is asked to Subscribe.


@gargol Is it correct to pass signup instead of subscribe if a user is not a member yet?
Please correct me if I am missing anything here.
Thanks!
Hey all!
We found out that the problem occurred because, by mistake, we had mailgun analytics turned on! After disabling them, now it's working well!
Thnks for your help!
Yes , as @ferranrego says, the mailgun service was rewriting the link in the subscription, and somehow the redirect was not working properly.
Disabling the "Button tracking" feature solved the issue
@ferranrego Glad that it got solved! Since the problem was not with Ghost, I think this issue can be closed now. @gargol
Personally, I don't think this is a solution. It's a workaround. I want Mailgun analytics on, including button tracking. So, now what?