Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Demodulize class name on mailer method lookup #208

Closed
StanisLove opened this issue Feb 22, 2022 · 2 comments
Closed

Demodulize class name on mailer method lookup #208

StanisLove opened this issue Feb 22, 2022 · 2 comments

Comments

@StanisLove
Copy link

Hi, mailer method is defined as an underscored class name if the method option wasn't provided

def method
method_name = options[:method]&.to_sym
if method_name.present?
notification.respond_to?(method_name) ? notification.send(method_name) : method_name
else
notification.class.name.underscore
end
end

But if I put my notification class to a module the result string will contain the name of that module as a prefix.

Employees::NotifyAboutNewOrder.name.underscore #=> "employees/notify_about_new_order"

I think it is appropriate to pre-demodulize a class name here.

@excid3
Copy link
Owner

excid3 commented Feb 22, 2022

Makes sense to me. Do you want to submit a PR for that?

@aka-nez
Copy link

aka-nez commented Sep 17, 2023

@excid3 hi! What you think about @StanisLove PR?

Repository owner locked and limited conversation to collaborators Oct 31, 2023
@Kentasmic Kentasmic converted this issue into discussion #331 Oct 31, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants