Class: Utils::GoogleService::SendEmail
- Inherits:
-
Object
- Object
- Utils::GoogleService::SendEmail
- Defined in:
- lib/bas/utils/google/send_email.rb
Overview
This module is a Google service utility to send emails from a google account
Constant Summary collapse
- SCOPES =
["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.send"].freeze
- CONTENT_TYPE =
"message/rfc822"
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(params) ⇒ SendEmail
constructor
A new instance of SendEmail.
Constructor Details
#initialize(params) ⇒ SendEmail
Returns a new instance of SendEmail.
15 16 17 18 19 20 21 22 23 |
# File 'lib/bas/utils/google/send_email.rb', line 15 def initialize(params) @refresh_token = params[:refresh_token] @client_id = params[:client_id] @client_secret = params[:client_secret] @user_email = params[:user_email] @recipient_email = params[:recipient_email] @subject = params[:subject] @message = params[:message] end |
Instance Method Details
#execute ⇒ Object
25 26 27 28 29 |
# File 'lib/bas/utils/google/send_email.rb', line 25 def execute { send_email: } rescue StandardError => e { error: e.to_s } end |