Skip to content
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

Merged
merged 6 commits into from
Sep 25, 2017

Conversation

Wynndow
Copy link
Contributor

@Wynndow Wynndow commented Sep 22, 2017

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 template

The templates are now managed by notify, so can be removed from here.

@Wynndow Wynndow requested a review from allait September 22, 2017 08:10
@Wynndow Wynndow force-pushed the move-supplier-user-creation-invite-emails-to-notify branch from 0651d2b to f04a853 Compare September 25, 2017 11:08
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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.
@Wynndow Wynndow force-pushed the move-supplier-user-creation-invite-emails-to-notify branch from f04a853 to bcfd835 Compare September 25, 2017 11:23
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.
@Wynndow Wynndow merged commit 11e140c into master Sep 25, 2017
@Wynndow Wynndow deleted the move-supplier-user-creation-invite-emails-to-notify branch September 25, 2017 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants