Magic link emails fail in production: “Missing host to link to” in MagicLinkMailer#sign_in_instructions #2941
Replies: 1 comment
-
|
The issue was not SMTP. The mailer job was failing before delivery because Rails could not generate the absolute URL inside the magic-link email. The error was: The fix was to add: BASE_URL=https://example.comThen restart the app/container. After adding In my case, the hosting platform automatically provided variables like So for self-hosted deployments, make sure |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Use this sanitized version. I replaced the real domain/email with placeholders.
Title
Magic link emails fail in production: “Missing host to link to” in
MagicLinkMailer#sign_in_instructionsDiscussion text
Hi, I’m self-hosting Fizzy and ran into an issue where login emails are not being sent.
The app itself seems to boot normally. Puma starts successfully, the
/uphealth check returns200 OK, and Solid Queue workers start correctly.When I submit the login form, the request reaches the backend correctly:
So the login form is working, and the mail delivery job is being created.
The problem happens when Solid Queue performs the mailer job:
The stack trace points here:
This makes it look like the email fails while rendering the magic-link URL, before it reaches SMTP.
My deployment has environment variables similar to:
I also tried adding:
But the same error still happens, so maybe Fizzy does not currently read those env vars into
config.action_mailer.default_url_optionsorRails.application.routes.default_url_options.My guess is that production needs something like this somewhere:
What is the intended way to configure the public app host/domain for magic-link emails in a self-hosted deployment? Is there a specific environment variable Fizzy expects for this, or should this be added to the production config?
Beta Was this translation helpful? Give feedback.
All reactions