module Platformx::Mail

Mail module @author Tim Mushen

Public Class Methods

init() click to toggle source

Conig mail

# File lib/platformx/mail.rb, line 7
def self.init
    #Pony Configs
     Pony.options = { 
      :from => Platformx.configuration.mail_from,
      :via => :smtp,
      :via_options => {
        :from => Platformx.configuration.mail_from,
        :address => Platformx.configuration.mail_address,
        :port => Platformx.configuration.mail_port,
        :domain => Platformx.configuration.mail_domain,
        :user_name => Platformx.configuration.mail_user_name,
        :enable_starttls_auto => true,
        :password => Platformx.configuration.mail_password,
        :authentication => :login
      }
    }
end
mail(to: "", cc: "", subject: "", html_body: "") click to toggle source

Send mail @param to [String] to addresses @param cc [String] cc addresses @param html_body [String] body of the message (in html)

# File lib/platformx/mail.rb, line 29
def self.mail(to: "", cc: "", subject: "", html_body: "")
    init
    Pony.mail(
      to: to, 
      cc: cc,
      subject: subject, 
      html_body: html_body
      )
end