Add configuration and documentation smtp setting

This commit is contained in:
Aditya Prakash 2016-04-07 13:49:28 +05:30
parent d770533bdc
commit 9abda59b0d
3 changed files with 27 additions and 0 deletions

View file

@ -86,6 +86,15 @@ the image-link to login using the provider will be shown.
#### Email Notifications #### 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. 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 rake jobs:work

View file

@ -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 # 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: '' 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'

View file

@ -68,4 +68,14 @@ Osem::Application.configure do
# Set the detault url for action mailer # Set the detault url for action mailer
config.action_mailer.default_url_options = { host: CONFIG['url_for_emails'] } 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 end