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

Create user account email class #335

Merged
merged 4 commits into from
Sep 22, 2017
Merged

Conversation

Wynndow
Copy link
Contributor

@Wynndow Wynndow commented Sep 21, 2017

The code for emailing a creation or invite email to a buyer or supplier
is really similar. We're also moving these emails to Notify which also
simplifies the process (no need for templates).

This class can be imported by the frontend apps and used to generate and
send the tokens and emails for user creation/invitiation.

The code for emailing a creation or invite email to a buyer or supplier
is really similar. We're also moving these emails to Notify which also
simplifies the process (no need for templates).

This class can be imported by the frontend apps and used to generate and
send the tokens and emails for user creation/invitiation.
from .helpers import hash_string


class UserAccountEmail():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like this could be a function. Class attributes are essentially used as arguments for the single method.
Do you think this will get extended in the future in a way that would be easier to do with a class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated to not be a class, and have imported the external blueprint from the supplier frontend.

As part of moving the logic for sending user account emails to a shared
place in utils, we can move the external blueprints from the supplier
frontend here too, and then import it in the app if needed.

Other apps external blueprints could be moved here too and shared.
@Wynndow Wynndow force-pushed the create-user-account-email-class branch from 0556bf4 to 8ab9bdc Compare September 22, 2017 15:27
This changes the logic to a function which can be imported and used in
the apps.

It also imports the external blueprint which has been moved to utils.
This means all logic can live in the function instead of having to pass
in the url as before.
@Wynndow Wynndow force-pushed the create-user-account-email-class branch from 8ab9bdc to 2578841 Compare September 22, 2017 15:32
@Wynndow Wynndow merged commit d90832e into master Sep 22, 2017
@Wynndow Wynndow deleted the create-user-account-email-class branch September 22, 2017 15:53
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