Class: Eco::API::Common::Session::Mailer::AwsProvider
- Inherits:
-
ProviderBase
- Object
- ProviderBase
- Eco::API::Common::Session::Mailer::AwsProvider
- Defined in:
- lib/eco/api/common/session/mailer/aws_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.
- #send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) ⇒ Object
Methods inherited from ProviderBase
#fetch_to, #initialize, to_desc
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.
30 31 32 |
# File 'lib/eco/api/common/session/mailer/aws_provider.rb', line 30 def configured? fetch_access_key_id && fetch_secret_access_key && fetch_region end |
#send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/eco/api/common/session/mailer/aws_provider.rb', line 8 def send_mail(subject:, body:, to: nil, cc: nil, bcc: nil) ses.send_email( destination: fetch_destination(to: to, cc: cc, bcc: bcc), source: fetch_from, message: { subject: { charset: "UTF-8", data: subject }, body: { # NOTE: (html) will let you send html instead # you can use both at once if you like text: { charset: "UTF-8", data: body } } } ) end |