Class: EacRailsBase0::EmailSendTest

Inherits:
EacRailsUtils::Models::Tableless
  • Object
show all
Defined in:
app/tableless_models/eac_rails_base0/email_send_test.rb

Instance Method Summary collapse

Instance Method Details

#addressObject



20
21
22
# File 'app/tableless_models/eac_rails_base0/email_send_test.rb', line 20

def address
  alternative_address.presence || logged_user_address.presence
end

#logged_user_addressObject



24
25
26
# File 'app/tableless_models/eac_rails_base0/email_send_test.rb', line 24

def logged_user_address
  ::EacUsersSupport::User.current_user.if_present(&:email)
end

#saveObject



13
14
15
16
17
18
# File 'app/tableless_models/eac_rails_base0/email_send_test.rb', line 13

def save
  return false unless valid?

  send_mail
  true
end

#send_mailObject



28
29
30
# File 'app/tableless_models/eac_rails_base0/email_send_test.rb', line 28

def send_mail
  ::EacRailsBase0::SendTestMailer.with(address: address).main.deliver_later
end