|
27 | 27 | config.force_ssl = ENV.fetch("RAILS_FORCE_SSL", "true").downcase != "false"
|
28 | 28 | RUBY
|
29 | 29 |
|
30 |
| -# TODO: it looks like these options are now spread across the config |
31 |
| -insert_into_file! "config/environments/production.rb", |
32 |
| - after: /# config\.action_mailer\.raise_deliv.*\n/ do |
33 |
| - <<-RUBY |
| 30 | +gsub_file! "config/environments/production.rb", |
| 31 | + "# config.action_mailer.raise_delivery_errors = false", |
| 32 | + "config.action_mailer.raise_delivery_errors = true" |
34 | 33 |
|
35 |
| - # Production email config |
36 |
| - config.action_mailer.raise_delivery_errors = true |
37 |
| - config.action_mailer.default_url_options = { |
38 |
| - host: "#{TEMPLATE_CONFIG.production_hostname}", |
39 |
| - protocol: "https" |
40 |
| - } |
41 |
| - config.action_mailer.asset_host = "https://#{TEMPLATE_CONFIG.production_hostname}" |
| 34 | +gsub_file! "config/environments/production.rb", |
| 35 | + 'config.action_mailer.default_url_options = { host: "example.com" }', |
| 36 | + "config.action_mailer.default_url_options = { host: \"#{TEMPLATE_CONFIG.production_hostname}\", protocol: \"https\" }" |
42 | 37 |
|
| 38 | +gsub_file! "config/environments/production.rb", |
| 39 | + <<-RUBY, |
| 40 | + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. |
| 41 | + # config.action_mailer.smtp_settings = { |
| 42 | + # user_name: Rails.application.credentials.dig(:smtp, :user_name), |
| 43 | + # password: Rails.application.credentials.dig(:smtp, :password), |
| 44 | + # address: "smtp.example.com", |
| 45 | + # port: 587, |
| 46 | + # authentication: :plain |
| 47 | + # } |
| 48 | +RUBY |
| 49 | + <<-RUBY |
| 50 | + config.action_mailer.asset_host = "https://#{TEMPLATE_CONFIG.production_hostname}" |
43 | 51 | config.action_mailer.smtp_settings = {
|
44 | 52 | address: ENV.fetch("SMTP_HOSTNAME"),
|
45 | 53 | port: ENV.fetch("SMTP_PORT", 587),
|
|
49 | 57 | authentication: "login",
|
50 | 58 | domain: "#{TEMPLATE_CONFIG.production_hostname}"
|
51 | 59 | }
|
52 |
| -
|
53 |
| - RUBY |
54 |
| -end |
| 60 | +RUBY |
55 | 61 |
|
56 | 62 | gsub_file! "config/environments/production.rb",
|
57 | 63 | 'ENV.fetch("RAILS_LOG_LEVEL", "info")',
|
|
0 commit comments