Skip to content

Commit

Permalink
Use public methods only when calling mailers. Fixes #457
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Jun 21, 2024
1 parent b1148c4 commit 91547b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Unreleased

* Use `public_send` for Email delivery so it doesn't accidentally call private methods.

### 2.3.2

* Set `:json` type on `:params` column with default to better integrate with ActiveRecord.
Expand Down
2 changes: 1 addition & 1 deletion lib/noticed/delivery_methods/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def deliver
mailer = fetch_constant(:mailer)
email = evaluate_option(:method)
args = evaluate_option(:args) || []
mail = mailer.with(params).send(email, *args)
mail = mailer.with(params).public_send(email, *args)
(!!evaluate_option(:enqueue)) ? mail.deliver_later : mail.deliver_now
end

Expand Down

0 comments on commit 91547b8

Please sign in to comment.