Class: ActionGmailer::DeliveryMethod
- Inherits:
-
Object
- Object
- ActionGmailer::DeliveryMethod
- Includes:
- Mail::CheckDeliveryParams
- Defined in:
- lib/action_gmailer.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#auth_type ⇒ Object
Returns the value of attribute auth_type.
-
#helo_domain ⇒ Object
Returns the value of attribute helo_domain.
-
#oauth2_token ⇒ Object
Returns the value of attribute oauth2_token.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#smtp_host ⇒ Object
Returns the value of attribute smtp_host.
-
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(settings) ⇒ DeliveryMethod
constructor
A new instance of DeliveryMethod.
Methods included from Mail::CheckDeliveryParams
Constructor Details
#initialize(settings) ⇒ DeliveryMethod
Returns a new instance of DeliveryMethod.
21 22 23 |
# File 'lib/action_gmailer.rb', line 21 def initialize(settings) self.settings = settings end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
19 20 21 |
# File 'lib/action_gmailer.rb', line 19 def account @account end |
#auth_type ⇒ Object
Returns the value of attribute auth_type.
18 19 20 |
# File 'lib/action_gmailer.rb', line 18 def auth_type @auth_type end |
#helo_domain ⇒ Object
Returns the value of attribute helo_domain.
18 19 20 |
# File 'lib/action_gmailer.rb', line 18 def helo_domain @helo_domain end |
#oauth2_token ⇒ Object
Returns the value of attribute oauth2_token.
19 20 21 |
# File 'lib/action_gmailer.rb', line 19 def oauth2_token @oauth2_token end |
#settings ⇒ Object
Returns the value of attribute settings.
15 16 17 |
# File 'lib/action_gmailer.rb', line 15 def settings @settings end |
#smtp_host ⇒ Object
Returns the value of attribute smtp_host.
17 18 19 |
# File 'lib/action_gmailer.rb', line 17 def smtp_host @smtp_host end |
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
17 18 19 |
# File 'lib/action_gmailer.rb', line 17 def smtp_port @smtp_port end |
Instance Method Details
#deliver!(mail) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/action_gmailer.rb', line 30 def deliver!(mail) envelope_from, destinations, = check_params(mail) smtp = Net::SMTP.new(smtp_host, smtp_port) smtp.enable_starttls_auto smtp.start(helo_domain, account, oauth2_token, auth_type) do smtp.sendmail(, envelope_from, destinations) end rescue StandardError => exp raise DeliveryError, exp. end |