-
Notifications
You must be signed in to change notification settings - Fork 150
Sending mails through other connection #374
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
Conversation
|
It looks like this change moves the email send into a new private method, but does not actually change the functionality at all. Can you explain your reasoning? |
|
That is correct, I implemented in a local test version as a public method. But I thought that the private method should be better. |
coderedcms/models/page_models.py
Outdated
| # Send email | ||
| self.__send_mail(request, message_args) | ||
|
|
||
| def __send_mail(self, resuest, message_args): |
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.
Let's make this public, e.g. send_mail() would be fine.
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.
Also, it doesn't look like the request arg is used/needed here.
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.
My use case has the next code, so request can not be removed
mail_settings = MailSettings.for_request(request)
connection = get_connection(
username=mail_settings.username, password=mail_settings.password, fail_silently=False
)Add optional method for content_subtype
This PR allows sending mails through other connections than the default in Django settings
The new connection can be created based on a Site Setting or just hardcoded.