Introduce suspenders:email generator#1162
Merged
stevepolitodesign merged 1 commit intosuspenders-3-0-0from Feb 28, 2024
Merged
Conversation
Comment on lines
+35
to
+49
| def configure_development_environment | ||
| environment %(config.action_mailer.default_url_options = { host: "localhost", port: 3000 }), env: "development" | ||
| end | ||
|
|
||
| def configure_test_environment | ||
| environment %(config.action_mailer.default_url_options = { host: "www.example.com" }), env: "test" | ||
| end |
Contributor
Author
There was a problem hiding this comment.
These might be able to be removed if rails/rails#51191 is merged.
Contributor
Author
There was a problem hiding this comment.
We can remove once there's a new release.
Comment on lines
+35
to
+49
| def configure_development_environment | ||
| environment %(config.action_mailer.default_url_options = { host: "localhost", port: 3000 }), env: "development" | ||
| end | ||
|
|
||
| def configure_test_environment | ||
| environment %(config.action_mailer.default_url_options = { host: "www.example.com" }), env: "test" | ||
| end |
Contributor
Author
There was a problem hiding this comment.
Also noting I didn't need to config.asset_host. Everything worked without issue in test and development.
c82f2ea to
c1ecef7
Compare
Creates [email interceptor][] to ensure emails are sent to preconfigured addresses in non-production environments. Drops support for [Recipient Interceptor][], since this functionality is supported in Rails Core. In order to enable the interceptor, set `EMAIL_RECIPIENTS` to a comma-separated list. ```sh INTERCEPTOR_ADDRESSES="[email protected],[email protected]" bin/rails s ``` Configures [default_url_options][] in `test` and `development` environments so that `*_url` helpers will work. Note that we do not configure `production`, since we've determined the `delivery_method` is something each project will configure independently. This means we'll just use the [default configuration][], which is `smtp`. [email interceptor]: https://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails [Recipient Interceptor]: https://github.com/croaky/recipient_interceptor [default_url_options]: https://guides.rubyonrails.org/action_mailer_basics.html#generating-urls-in-action-mailer-views [default configuration]: https://guides.rubyonrails.org/configuring.html#config-action-mailer-delivery-method
c1ecef7 to
19ce9b1
Compare
mike-burns
approved these changes
Feb 28, 2024
stevepolitodesign
added a commit
that referenced
this pull request
May 10, 2024
Creates [email interceptor][] to ensure emails are sent to preconfigured addresses in non-production environments. Drops support for [Recipient Interceptor][], since this functionality is supported in Rails Core. In order to enable the interceptor, set `EMAIL_RECIPIENTS` to a comma-separated list. ```sh INTERCEPTOR_ADDRESSES="[email protected],[email protected]" bin/rails s ``` Configures [default_url_options][] in `test` and `development` environments so that `*_url` helpers will work. Note that we do not configure `production`, since we've determined the `delivery_method` is something each project will configure independently. This means we'll just use the [default configuration][], which is `smtp`. [email interceptor]: https://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails [Recipient Interceptor]: https://github.com/croaky/recipient_interceptor [default_url_options]: https://guides.rubyonrails.org/action_mailer_basics.html#generating-urls-in-action-mailer-views [default configuration]: https://guides.rubyonrails.org/configuring.html#config-action-mailer-delivery-method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates email interceptor to ensure emails are sent to preconfigured
addresses in non-production environments. Drops support for Recipient
Interceptor, since this functionality is supported in Rails Core.
In order to enable the interceptor, set
EMAIL_RECIPIENTSto acomma-separated list.
INTERCEPTOR_ADDRESSES="[email protected],[email protected]" bin/rails sConfigures default_url_options in
testanddevelopmentenvironments so that
*_urlhelpers will work.Note that we do not configure
production, since we've determined thedelivery_methodis something each project will configureindependently. This means we'll just use the default configuration,
which is
smtp.