-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Html mailing #317
base: master
Are you sure you want to change the base?
Feature/Html mailing #317
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #317 +/- ##
==========================================
- Coverage 95.84% 95.23% -0.61%
==========================================
Files 145 153 +8
Lines 6113 6342 +229
Branches 968 994 +26
==========================================
+ Hits 5859 6040 +181
- Misses 174 220 +46
- Partials 80 82 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
|
||
class MailForm(forms.Form): | ||
"""A simple form to construct and send_to e-mails""" | ||
to = forms.EmailField() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
to = forms.EmailField() | |
to = forms.EmailField() |
SimpleMessageEmail( | ||
message=self.cleaned_data['text'], | ||
subject=self.cleaned_data['subject'] | ||
).send_to([self.cleaned_data['to']]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
SimpleMessageEmail( | |
message=self.cleaned_data['text'], | |
subject=self.cleaned_data['subject'] | |
).send_to([self.cleaned_data['to']]) | |
SimpleMessageEmail(message=self.cleaned_data["text"], subject=self.cleaned_data["subject"]).send_to( | |
[self.cleaned_data["to"]] | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want this on multiple lines, use a comma
Renders and sends emails in a predefined template. It's basically the email alternative to the View class | ||
:param template_name: The path and name of the template (without extention) | ||
""" | ||
template_name: str = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
template_name: str = None | |
template_name: str = None |
mailing/mailing.py
Outdated
|
||
def _get_mail_templates(self, extension: str): | ||
"""Gets the mail template with the given extention""" | ||
return get_template(f"{self.template_name}.{extension}", using='EmailTemplates') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
return get_template(f"{self.template_name}.{extension}", using='EmailTemplates') | |
return get_template(f"{self.template_name}.{extension}", using="EmailTemplates") |
|
||
__all__ = ["MailTestingMixin"] | ||
|
||
class MailTestingMixin(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
class MailTestingMixin(TestCase): | |
class MailTestingMixin(TestCase): |
squire/settings.py
Outdated
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
] | |
} | |
} | |
], | |
}, | |
}, |
squire/settings.py
Outdated
) | ||
] | ||
} | ||
} | ||
] | ||
|
||
WSGI_APPLICATION = 'squire.wsgi.application' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
WSGI_APPLICATION = 'squire.wsgi.application' | |
WSGI_APPLICATION = "squire.wsgi.application" |
@@ -257,6 +274,9 @@ | |||
os.path.join(BASE_DIR, 'core', 'static_compiled'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
os.path.join(BASE_DIR, 'core', 'static_compiled'), | |
os.path.join(BASE_DIR, "core", "static_compiled"), |
squire/settings.py
Outdated
@@ -257,6 +274,9 @@ | |||
os.path.join(BASE_DIR, 'core', 'static_compiled'), | |||
] | |||
|
|||
# Email settings | |||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | |
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" |
squire/settings.py
Outdated
@@ -257,6 +274,9 @@ | |||
os.path.join(BASE_DIR, 'core', 'static_compiled'), | |||
] | |||
|
|||
# Email settings | |||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | |||
|
|||
|
|||
# The directory in which the coverage reports should be stored | |||
COVERAGE_REPORT_DIR = os.path.join(BASE_DIR, 'coverage') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
COVERAGE_REPORT_DIR = os.path.join(BASE_DIR, 'coverage') | |
COVERAGE_REPORT_DIR = os.path.join(BASE_DIR, "coverage") |
Added missing code comments. Added global preferences for registration email footers. This should be refactored once #317 is merged.
Added ability to use HTML templates with emails