Skip to content
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

Update how to configure Action Mailer interceptors/observers #42174

Merged
merged 1 commit into from
May 8, 2021

Conversation

pixeltrix
Copy link
Contributor

Unsure about the style of the example here - typically we use single lines like this:

Rails.application.config.action_mailer.interceptors = %w[MyInterceptor]

However it causes the configuration to wrap in the guides template so I re-wrote it to use the block form like this:

Rails.application.configure do
  config.action_mailer.interceptors = %w[MyInterceptor]
end

Is this pattern something we want to expose? It just uses instance_eval on the block.

@rails-bot rails-bot bot added the docs label May 8, 2021
Copy link
Member

@zzak zzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the block syntax because Rails should already generate this for you, I'm curious why there wouldn't be a "staging.env" but that is not relevant here imo

@zzak zzak merged commit cb2ed01 into main May 8, 2021
@zzak zzak deleted the fix-action-mailer-basics-guide branch May 8, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants