This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config.action_mailer.delivery_method = :ses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base, | |
:access_key_id =>ENV['AMAZON_ACCESS_KEY'], | |
:secret_access_key =>ENV['AMAZON_SECRET_KEY'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "aws-ses", "~> 0.6.0", :require => 'aws/ses' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#call deliver from mailer action | |
SesMailer.welcome.deliver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome email! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class SesMailer < ActionMailer::Base | |
default from: 'test@example.com' | |
def welcome | |
mail(to:'somebody@email.com', subject: 'I emailed from AmazonSES!') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |