Skip to content

Instantly share code, notes, and snippets.

View MeenakshiNaik's full-sized avatar

Meenakshi Naik MeenakshiNaik

  • Idyllic Software
  • India
View GitHub Profile
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings= {
:address => 'email-smtp.us-east-1.amazonaws.com',
:authentication => :login,
:user_name => '<previously configured smtp username>',
:password => '<previously configured smtp password>',
:enable_starttls_auto => true,
:port => 465
}
Class SesMailer < ActionMailer::Base
default from: 'test@example.com'
def welcome
mail(to:'somebody@email.com', subject: 'I emailed from AmazonSES!')
end
end
#call deliver from mailer action
SesMailer.welcome.deliver
gem "aws-ses", "~> 0.6.0", :require => 'aws/ses'
ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
:access_key_id =>ENV['AMAZON_ACCESS_KEY'],
:secret_access_key =>ENV['AMAZON_SECRET_KEY']
Config.action_mailer.delivery_method = :ses
#TEMP FILE
# ISSUED
def self.total_qty_initial(account)
Offer.where(account_id: account.id, active: true, offer_status: ['live', 'ended']).sum(:qty_initial)
end
# NEW USERS
def self.total_new_users(account)
offers = Offer.where(account_id: account.id)