aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/environments/production.rb15
-rw-r--r--config/general.yml-example27
2 files changed, 41 insertions, 1 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index a3e3cebd2..af2ca15b9 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -17,7 +17,20 @@ Alaveteli::Application.configure do
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
- config.action_mailer.delivery_method = :sendmail # so is queued, rather than giving immediate errors
+
+ config.action_mailer.delivery_method = AlaveteliConfiguration::production_mailer_delivery_method.to_sym
+
+ if AlaveteliConfiguration::production_mailer_delivery_method.to_sym == :smtp
+ config.action_mailer.smtp_settings = {
+ :address => AlaveteliConfiguration::smtp_mailer_address,
+ :port => AlaveteliConfiguration.smtp_mailer_port,
+ :domain => AlaveteliConfiguration.smtp_mailer_domain,
+ :user_name => AlaveteliConfiguration.smtp_mailer_user_name,
+ :password => AlaveteliConfiguration.smtp_mailer_password,
+ :authentication => AlaveteliConfiguration.smtp_mailer_authentication,
+ :enable_starttls_auto => AlaveteliConfiguration.smtp_mailer_enable_starttls_auto
+ }
+ end
config.active_support.deprecation = :notify
diff --git a/config/general.yml-example b/config/general.yml-example
index 8acea374b..88d89958d 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -775,3 +775,30 @@ ALLOW_BATCH_REQUESTS: false
#
# ---
RESPONSIVE_STYLING: true
+
+# Define the mailer delivery method to be used only in the production environment.
+# By default, use sendmail.
+#
+# The list of accepted options are available in the Rails ActionMailer configuration
+# documentation: http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration
+#
+# The most common alternative is to use 'smtp'
+# If you choose to use an external SMTP service then you will need to also include the SMTP configuration settings.
+#
+# As a string this is coerced into a symbol in config/environments/production.rb
+#
+# PRODUCTION_MAILER_DELIVERY_METHOD - String (default: sendmail)
+#
+# Examples:
+#
+# PRODUCTION_MAILER_DELIVERY_METHOD: smtp
+# SMTP_MAILER_ADDRESS: smtp.gmail.com
+# SMTP_MAILER_PORT: 587
+# SMTP_MAILER_DOMAIN: example.com
+# SMTP_MAILER_USER_NAME: jane322
+# SMTP_MAILER_PASSWORD: supersecretpassword
+# SMTP_MAILER_AUTHENTICATION: 'plain'
+# SMTP_MAILER_ENABLE_STARTTLS_AUTO: true
+# ---
+PRODUCTION_MAILER_DELIVERY_METHOD: sendmail
+