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
Add email producer #425
Add email producer #425
Conversation
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.
Возможно следует добавить в settings настройки связанные с email
EMAIL_USE_TLS = True
EMAIL_HOST = os.environ.get('EMAIL_HOST', 'smtp.gmail.com')
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_PORT = os.environ.get('EMAIL_PORT', 587)
Так же Даниил Солодилов просил перейти с smtp.gmail.com на smtp-relay.gmail.com. Инструкция по smpt-rely тут https://support.google.com/a/answer/176600?hl=ru
email.attach_alternative(html_body, 'text/html') | ||
|
||
if self._files: | ||
for file_wrapper in self._files: |
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.
Что за объект file_wrapper
?
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.
там в тайпинге написано: EmailFileWrapper
core/utils/mail.py
Outdated
self._emails_bcc = emails_bcc | ||
self._files = files | ||
|
||
def _get_email_subject(self) -> str: |
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.
Предлагаю сделать методы _get_email_subject
, _get_plain_email_body
, _get_html_email_body
публичными т.к. подразумевается их переопределение в дочерних классах
ad79614
to
b2ea778
Compare
b2ea778
to
13cf35b
Compare
Может хоть один тест написать? |
Пример использования