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

Issue with performing jobs that use ActionMailer::Parameterized #944

Closed
RailsCod3rFuture opened this issue Apr 30, 2023 · 3 comments
Closed

Comments

@RailsCod3rFuture
Copy link

I am receiving an error for a missing method on ActionMailer object.

[ActiveJob] [Noticed::DeliveryMethods::Email] [53d92cb5-747e-4939-b4e1-1ef03594711c] Error performing Noticed::DeliveryMethods::Email (Job ID: 53d92cb5-747e-4939-b4e1-1ef03594711c) from GoodJob(default) in 92.31ms: NoMethodError (undefined method report_notification' for #<ActionMailer::Parameterized::Mailer:0x000000011b536d28 @mailer=ReportNotificationMailer, @params={:report=>#<Report id: 2...`

How do you get GoodJob to work with parameterized mailers?

@bensheldon
Copy link
Owner

bensheldon commented Apr 30, 2023

GoodJob should work out of the box with ActionMailer.

From the error you shared, it looks like you're calling something like this:

ReportNotificationMailer.with(report: my_report).report_notification.deliver_later

Does that match up with what you expect? I imagine that there is some problem with the report_notification method (that "method missing" error). Is that the correct name of the Mailer action? Also, are you running this locally in development/async, or are you seeing this when running the good_job cli? If it's the good_job cli I think you need to restart if you're developing and you just created the method.

@RailsCod3rFuture
Copy link
Author

I believe its an issue with the gem noticed. I opted to call the mailer exactly how you have it written above in the same action that does the noticed background job. Its working as expected now. Thank you! -- I would have forgotten to update this thread if you hadn't responded - I appreciate the promptness!

@bensheldon
Copy link
Owner

@RailsCod3rFuture yay! happy to help 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants