-
Notifications
You must be signed in to change notification settings - Fork 65
Email from web apps is complex. All mail sent from your journals is sent from a from_address
setting that you can set via Journal Settings. This email address should be one that your email server has permission to send on behalf of. When a user triggers an email being sent, and they are logged in, that email will have a reply-to tagged so that even though the message is sent from from_address
it will display that user's name and any replies to the message will come to them.
We will detail two ways of setting up email with Janeway:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = ''
EMAIL_PORT = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
If you intend to use SMTP for sending mail, your settings.py file will have something like this in it (this is taken from example_settings.py). Here we will complete it with example variables:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.example.com'
EMAIL_PORT = '25'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'thisisanexamplepassword'
EMAIL_USE_TLS = True
You could then set from_address
to something like [email protected]
.
At Open Library of Humanities, we make use of Mailgun for sending our emails. A Mailgun backend is included in the installation package, so setting up is easy, your Email settings will look like:
EMAIL_BACKEND = 'django_mailgun.MailgunBackend'
MAILGUN_ACCESS_KEY = 'key-yourmailgunapikeyhere'
MAILGUN_SERVER_NAME = 'mail.openlibhums.org'
The package and mailgun take care of the rest. We set our from address to [email protected]
Wiki has moved to read the docs.