2.6. Email Configuration¶
OnTask relies on the functionality included in Django to send emails from the application. The following variables can be used in the configuration file:
EMAIL_HOSTHost providing the SMTP service.
Default:
''EMAIL_PORTPort to communicate with the host
Default:
''EMAIL_HOST_USERUser account to log into the email host
Default:
''EMAIL_HOST_PASSWORDPassword for the account to log into the email host
Default:
''EMAIL_USE_TLSBoolean stating if the communication should use TLS
Default:
FalseEMAIL_USE_SSLBoolean stating if the communication should use SSL
Default:
FalseEMAIL_ACTION_NOTIFICATION_SENDERAddress to use when sending notifications
Default:
''EMAIL_HTML_ONLYSend HTML text only, or alternatively, send text and HTML as an attachment
Default:
True(send HTML only)EMAIL_BURSTNumber of consecutive emails to send before pausing (to adapt to potential throttling of the SMTP server)
Default:
0EMAIL_BURST_PAUSENumber of seconds to wait between bursts.
Default:
0
An example of the content in the configuration is:
EMAIL_HOST=smtp.yourinstitution.org
EMAIL_PORT=334
EMAIL_HOST_USER=mailmaster
EMAIL_HOST_PASSWORD=somepassword
EMAIL_USE_TLS=False
EMAIL_USE_SSL=False
EMAIL_ACTION_NOTIFICATION_SENDER=ontaskmaster@yourinstitution.org
EMAIL_BURST=500
EMAIL_BURST_PAUSE=43200
Set theses variables in the configuration file to the appropriate values before starting the application. Make sure the server is running in production mode. The development mode is configured to not send emails but show their content in the console instead.
2.6.1. Tracking Email Reads¶
If OnTask is deployed using SAML, all URLs are likely to be configured to go through the authentication layer. This configuration prevents OnTask from receiving the email read confirmations. In this case, the web server needs to be configured so that the SAML authentication is removed for the URL trck (the one receiving the email read tracking). In Apache, this can be achieved by the following directive:
<Location /trck>
Require all granted
</Location>
If OnTask is not served from the root of your web server, make sure you include the absolute URL to trck. For example, if OnTask is available through the URL my.server.com/somesuffix/ontask, then the URL to use in the previous configuration is my.server.com/somesuffix/ontask/trck.