-
Notifications
You must be signed in to change notification settings - Fork 24
Add incuna-pigeon to send notifications
#107
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
|
👍 |
|
Not yet ready still need a setting to use a custom |
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.
You use {{ protocol }} elsewhere. Is there a reason to be different 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.
Yes it should be protocol
user_management/models/mixins.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.
You could add a Notification subclass and attach text_email_template and html_email_template as class attributes. In projects we've then added the Notification subclass to an AppConfig to allow overriding/extension.
* `password_reset_notification` * `validation_notification`
|
Updated |
user_management/models/mixins.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.
First line of multiline docstrings on new line, please.
|
Updated |
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_custom_email.txt'
user_management/models/mixins.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.
I would do from user_management.utils import notifications and then notifications.PasswordResetNotification later.
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.
Instead of mocking the notification, you could mock the user I think. You don't care how uid or token are calculated for this test.
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.
Both notification and user are very silly.
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.
Huh? Can you explain what you mean?
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.
Instead of mocking the
notification, you could mock theuserI think.
user are a stupid-head. :P
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.
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.
😒
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.
Makes sense I think, the link (uid and token) is already asserted when rendering the template, probably best to make an assertCountEqual.
0a7402b to
ed0563f
Compare
|
Don't merge yet I've spotted an error in the templates |
01a2db7 to
5dbf92e
Compare
|
Templates have been updated |
Add `incuna-pigeon` to send notifications

It looks like we have two different behaviors to send emails in
django-user-management.In some places we are sending html and text emails and in
PasswordResetwe only send html emails.Using
incuna-pigeonwould make sending emails behaving the same accross the project and would allow apps usingdjango-user-managementto customise handlers to send emails.As this project is compatible with django1.6 and 1.7, I think it makes sense to define the notification handlers in settings.