-
Notifications
You must be signed in to change notification settings - Fork 21
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
Move supplier user creation invite emails to notify #747
Move supplier user creation invite emails to notify #747
Conversation
0651d2b
to
f04a853
Compare
It includes the shared code for sending user create/invite emails as well as the external views.
As part of the supplier sign up flow a user creation email is sent to a given email address. This was done by Mandrill, now it's done by Notify. The functionality to do this for supplier users and buyer users is really similar so the code to do it has been abstracted to dmutils. We import it here and use it.
Supplier creation was moved to the user app. Any tokens created before the move will have linked to the supplier app still. Tokens are valid for one week, so we needed to maintain the functionality of those tokens by keeping a redirect on the old route to the user app. It's been over a week so all tokens will now link to the user app. We can remove this redirect and associate test.
External views are being moved to utils where they can be shared across all frontend apps.
|
||
from .. import main | ||
from ..forms.auth_forms import EmailAddressForm | ||
from ..helpers import hash_email, login_required |
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.
Is hash_email
used by anything else or could we delete the helper function as well? There's a shared one in dmutils now that we should probably switch to if it is used.
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.
It's used in app/main/view/frameworks, but could probable update to use the utils one. I'm going to check they have the same functionality though.
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.
Yep, have removed the helper and used the one from utils.
The templates are now managed by notify, so can be removed from here.
f04a853
to
bcfd835
Compare
Having removed the use of `hash_email` from the sending of supplier user create/invite emails, frameworks was the only place still using. This imports `hash_string` from utils and means the helper can be dropped from the supplier-frontend.
Tests will need this PR on utils to be merged before going green: Crown-Commercial-Service/digitalmarketplace-utils#335
Part of this ticket: https://trello.com/c/HlSz9QZZ
Pull in utils 28.5.0
It includes the shared code for sending user create/invite emails as
well as the external views.
Send supplier create emails with Notify
As part of the supplier sign up flow a user creation email is sent to a
given email address. This was done by Mandrill, now it's done by Notify.
The functionality to do this for supplier users and buyer users is
really similar so the code to do it has been abstracted to dmutils. We
import it here and use it.
Remove old redirect for user creation
Supplier creation was moved to the user app. Any tokens created before
the move will have linked to the supplier app still. Tokens are valid
for one week, so we needed to maintain the functionality of those
tokens by keeping a redirect on the old route to the user app.
It's been over a week so all tokens will now link to the user app. We
can remove this redirect and associate test.
Import external views from utils
External views are being moved to utils where they can be shared across
all frontend apps.
Remove unused
invite_user_email
templateThe templates are now managed by notify, so can be removed from here.