-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass default_url_options from mailer #188
Conversation
56caab9
to
714a154
Compare
Great solution! |
The tests are failing. I think maybe due to your refresh mechanism not working as intended? |
I had some troubles running the tests locally (fixed that now) and indeed this does not seem to work without side effects. I'll have another look at it at a later point! |
I think I found a different solution, tests are constantly green for me now! |
At least it's green! I think it'd be better to move all this from the general |
Yeah that could work as well 👍 but I think there will always be the possibility that a future test needs to override But happy to move it to the test itself as well, let me know. |
Let's move it now and move it back when it becomes necessary. Thanks! |
@mikker: I've moved some things around with comments so that it's clear what's going on. |
@mikker is there anything I can do to get this merged in? would love to see it released :) |
Sorry, no, it's good. Thank you! |
This is a bit related to #187, with the same behavior where we set the hostname dynamically based on locale.
With the introduction of the context in 1.1.0 (I think?) (PR: #180). the url helpers are no longer using the
default_url_options
from the mailer (either viaconfig.action_mailer.default_url_options
or when overriding them in a mailer themselves via adefault_url_options
method).This PR fixes that by passing them as arguments to the
url_for
method from the context.This probably also means you no longer necessarily need to to set a default host for the routes as well, as mentioned here in the docs:
passwordless/README.md
Lines 148 to 155 in cd0e0ed
I also added a reload when using
WithConfig
, as the parent class for the mailer is set from the config and that can change based on usage of the helper. This probably also needs to be included in #187.Let me know what you think!