Class: Noticed::DeliveryMethods::Email
- Inherits:
-
Noticed::DeliveryMethod
- Object
- Noticed::DeliveryMethod
- Noticed::DeliveryMethods::Email
- Defined in:
- lib/noticed/delivery_methods/email.rb
Instance Attribute Summary
Attributes inherited from Noticed::DeliveryMethod
#config, #event, #notification
Instance Method Summary collapse
Methods inherited from Noticed::DeliveryMethod
#evaluate_option, #fetch_constant, #perform
Methods included from ApiClient
Instance Method Details
#deliver ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/noticed/delivery_methods/email.rb', line 6 def deliver mailer = fetch_constant(:mailer) email = evaluate_option(:method) args = evaluate_option(:args) || [] mail = mailer.with(params).send(email, *args) (!!evaluate_option(:enqueue)) ? mail.deliver_later : mail.deliver_now end |
#params ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/noticed/delivery_methods/email.rb', line 14 def params (evaluate_option(:params) || notification&.params || {}).merge( notification: notification, record: notification&.record, recipient: notification&.recipient ) end |