Class: Eco::API::Common::Session::Mailer::SendgridProvider
- Inherits:
-
ProviderBase
- Object
- ProviderBase
- Eco::API::Common::Session::Mailer::SendgridProvider
- Defined in:
- lib/eco/api/common/session/mailer/sendgrid_provider.rb
Instance Attribute Summary
Attributes inherited from ProviderBase
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
-
#configured? ⇒ Boolean
Whether or not the mailer is configured for usage.
- #fetch_to(value = nil) ⇒ Object
- #send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) ⇒ Object
Methods inherited from ProviderBase
Methods included from Language::AuxiliarLogger
Constructor Details
This class inherits a constructor from Eco::API::Common::Session::Mailer::ProviderBase
Instance Method Details
#configured? ⇒ Boolean
Returns whether or not the mailer is configured for usage.
24 25 26 |
# File 'lib/eco/api/common/session/mailer/sendgrid_provider.rb', line 24 def configured? fetch_secret_access_key end |
#fetch_to(value = nil) ⇒ Object
18 19 20 21 |
# File 'lib/eco/api/common/session/mailer/sendgrid_provider.rb', line 18 def fetch_to(value = nil) emails = [super].flatten.compact to_email_model(emails) end |
#send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/eco/api/common/session/mailer/sendgrid_provider.rb', line 4 def send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) return false unless sendgrid data = to_data( subject: subject, body: body, to: to, cc: cc, bcc: bcc ) mailer._('send').post(request_body: data) end |