mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
Move EMAIL_FROM to WGER_SETTINGS dictionary
This makes the behaviour more consistent, as there are already application specifig configurations there.
This commit is contained in:
@@ -19,6 +19,9 @@ dictionary in your settings file. Currently the following options are supported:
|
||||
middleware instead. Read the django documentation on the security implications
|
||||
(BREACH attack).
|
||||
|
||||
**EMAIL_FROM**: Default `wger Workout Manager <wger@example.com>`
|
||||
The sender address used for sent emails by the system such as weight reminders
|
||||
|
||||
|
||||
.. note::
|
||||
If you want to override a default setting, don't overwrite all the dictionary
|
||||
|
||||
@@ -315,7 +315,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
|
||||
message = render_to_string('exercise/email_new.html', context)
|
||||
mail.send_mail(subject,
|
||||
message,
|
||||
settings.EMAIL_FROM,
|
||||
settings.WGER_SETTINGS['EMAIL_FROM'],
|
||||
[user.email],
|
||||
fail_silently=True)
|
||||
|
||||
|
||||
@@ -101,6 +101,6 @@ class Command(BaseCommand):
|
||||
message = render_to_string('gym/email_inactive_members.html', context)
|
||||
mail.send_mail(subject,
|
||||
message,
|
||||
settings.EMAIL_FROM,
|
||||
settings.WGER_SETTINGS['EMAIL_FROM'],
|
||||
[trainer.email],
|
||||
fail_silently=True)
|
||||
|
||||
@@ -122,6 +122,6 @@ class Command(BaseCommand):
|
||||
message = loader.render_to_string('workout/email_reminder.tpl', context)
|
||||
mail.send_mail(subject,
|
||||
message,
|
||||
settings.EMAIL_FROM,
|
||||
settings.WGER_SETTINGS['EMAIL_FROM'],
|
||||
[user.email],
|
||||
fail_silently=True)
|
||||
|
||||
@@ -430,7 +430,7 @@ class Ingredient(AbstractLicenseModel, models.Model):
|
||||
message = render_to_string('ingredient/email_new.html', context)
|
||||
mail.send_mail(subject,
|
||||
message,
|
||||
settings.EMAIL_FROM,
|
||||
settings.WGER_SETTINGS['EMAIL_FROM'],
|
||||
[self.user.email],
|
||||
fail_silently=True)
|
||||
|
||||
|
||||
@@ -58,4 +58,4 @@ if DEBUG:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
|
||||
# Sender address used for sent emails
|
||||
EMAIL_FROM = 'wger Workout Manager <your.email@example.com>'
|
||||
WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager <wger@example.com>'
|
||||
|
||||
@@ -348,5 +348,6 @@ IGNORABLE_404_URLS = (
|
||||
WGER_SETTINGS = {
|
||||
'USE_RECAPTCHA': False,
|
||||
'REMOVE_WHITESPACE': False,
|
||||
'ALLOW_REGISTRATION': True
|
||||
'ALLOW_REGISTRATION': True,
|
||||
'EMAIL_FROM': 'wger Workout Manager <wger@example.com>'
|
||||
}
|
||||
|
||||
@@ -79,6 +79,6 @@ class Command(BaseCommand):
|
||||
message = loader.render_to_string('workout/email_weight_reminder.tpl', context)
|
||||
mail.send_mail(subject,
|
||||
message,
|
||||
settings.EMAIL_FROM,
|
||||
settings.WGER_SETTINGS['EMAIL_FROM'],
|
||||
[user.email],
|
||||
fail_silently=True)
|
||||
|
||||
Reference in New Issue
Block a user