After my last post (Howto install Redmine on Heroku), I wanted to enable email notifications on my Redmine install on Heroku.
Here is the quick howto.
Please note that Heroku does not have its own SMTP server (at least for the free offer). Therefore you’ll have to use an external SMTP server.
- Create (by copying
config/configuration.yml.example) or edit your
config/configuration.ymlfile. This file will contain your SMTP configuration:
# specific configuration options for production environment # that overrides the default ones production: email_delivery: delivery_method: :smtp smtp_settings: address: your_smtp_server.com port: 25 domain: your_smtp_server.com authentication: :plain enable_starttls_auto: false user_name: "your_smtp_user_name" password: "your_smtp_password"
For those of you that have more complex authentication methods, or special SMTP parameters (for GMail for example), you can check this page.
- Add this configuration file in Git. For this, edit
.gitignoreand make sure that
config/configuration.ymlis not part of it.
- Commit your files and push them:
git add .
git commit -m"Setting up email"
git push heroku master
- Test it, by going to your Heroku application, under Administration -> Settings -> Email notifications then click on “Send a test email” at the bottom of the page. This will send you a mail, or display an error. Googling the errors helped me a lot in debugging it.