Skip to content

Commit

Permalink
mailer options in config
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaltom committed Jun 8, 2018
1 parent 477fa99 commit b8403d4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: OPTS.mail_from
default from: OPTS.mail_settings['from']
layout 'mailer'
end
14 changes: 8 additions & 6 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
# config.action_view.raise_on_missing_translations = true

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
address: '',
port: 587,
user_name: '',
password: '',
authentication: 'plain',
enable_starttls_auto: true
address: OPTS.mail_settings['address'],
port: OPTS.mail_settings['port'],
user_name: OPTS.mail_settings['user_name'],
password: OPTS.mail_settings['password'],
authentication: OPTS.mail_settings['authentication'],
enable_starttls_auto: OPTS.mail_settings['enable_starttls_auto']
}

end
12 changes: 6 additions & 6 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: '',
port: 587,
user_name: '',
password: '',
authentication: 'plain',
enable_starttls_auto: true
address: OPTS.mail_settings['address'],
port: OPTS.mail_settings['port'],
user_name: OPTS.mail_settings['user_name'],
password: OPTS.mail_settings['password'],
authentication: OPTS.mail_settings['authentication'],
enable_starttls_auto: OPTS.mail_settings['enable_starttls_auto']
}
end
10 changes: 8 additions & 2 deletions config/options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ default:
background_color: '#f1f1f2'
combined_image_fontsize: 48

mail_from: 'noreply@photobooth.org'

mail_settings:
from: ''
address: ''
port: 587
user_name: ''
password: ''
authentication: 'plain'
enable_starttls_auto: true

dropbox:
# raspi photobooth dropbox app:
Expand Down

0 comments on commit b8403d4

Please sign in to comment.