diff --git a/INSTALL.md b/INSTALL.md index d0f5cad8..9ee16f86 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -86,6 +86,15 @@ the image-link to login using the provider will be shown. #### Email Notifications +Check your service provider smtp settings and set the following variables in `config.yml` file: +``` +mail_address: 'smtp.host.com' +mail_port: 587 +mail_username: 'username@host.com' +mail_password: 'password' +mail_authentication: 'plain' +``` + Open a separate terminal and go into the directory where the rails app is present, and type the following to start the delayed_jobs worker for sending email notifications. ``` rake jobs:work diff --git a/config/config.yml.example b/config/config.yml.example index 226cc4b5..0e46666b 100644 --- a/config/config.yml.example +++ b/config/config.yml.example @@ -31,3 +31,11 @@ production: # If you add more providers that do not require a key, you still have to create the 2 variables with sample data transifex_live_api_key: '' + + # Set the smtp configuration of your service provider + # For further details of each configuration checkout: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration + mail_address: 'smtp.host.com' + mail_port: 587 + mail_username: 'username@host.com' + mail_password: 'password' + mail_authentication: 'plain' diff --git a/config/environments/production.rb b/config/environments/production.rb index 97bb10d6..530b821b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -68,4 +68,14 @@ Osem::Application.configure do # Set the detault url for action mailer config.action_mailer.default_url_options = { host: CONFIG['url_for_emails'] } + + # Set the smtp configuration of your service provider + # For further details of each configuration checkout: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration + config.action_mailer.smtp_settings = { + address: CONFIG['MAIL_ADDRESS'], + port: CONFIG['MAIL_PORT'], + user_name: CONFIG['MAIL_USERNAME'], + password: CONFIG['MAIL_PASSWORD'], + authentication: CONFIG['MAIL_AUTHENTICATION'] + } end