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

Note to newly regsitering users #961

Open
2 tasks
marycklein opened this issue Nov 27, 2023 · 3 comments
Open
2 tasks

Note to newly regsitering users #961

marycklein opened this issue Nov 27, 2023 · 3 comments

Comments

@marycklein
Copy link
Member

marycklein commented Nov 27, 2023

When a person "registers," they get no feedback, but are just tossed back onto home page with no evidence of success.

Instead, could they be rewarded with a message that says something like: "Thanks for starting to register an account on our website. To complete your registration, please check your email for an message from us. You should have just received one. Please look in your spam / junk folder if our message is not in your inbox.

Also,
Please revise the message they get in that email so that it says something like: "Thanks for beginning your registration process on the Western Friend website. To complete your registration, click on the link below. If the link doesn't respond, please cut an paste it into your browser, then hit your return key.

Task

  • update registration page to use the Django messages framework to display the following message directly on the website after the user submits the registration form
    • "Thanks for starting to register an account on our website. To complete your registration, please check your email for an message from us. You should have just received one. Please look in your spam / junk folder if our message is not in your inbox."
  • update the registration confirmation email template to include the following text:
    • "Thanks for beginning your registration process on the Western Friend website. To complete your registration, click on the link below. If the link doesn't respond, please cut an paste it into your browser, then hit your return key."

Resources

This project is already configured to use and correctly messages from the Django messages framework. So, we should only need a small change to trigger the message, as described in the Django messages documentation.

check_email_message = "Thanks for starting to register an account on our website. To complete your registration, please check your email for an message from us. You should have just received one. Please look in your spam / junk folder if our message is not in your inbox"

messages.info(request, check_email_message)

The message should be added within a callback of our CustomRegistrationView such as the form_valid handler which redirects to the main page:

class CustomRegistrationView(RegistrationView):
form_class = CustomUserForm
success_url = "/"
template_name = "django_registration/registration_form.html"
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
"""Add honeypot field to context."""
context = super().get_context_data(**kwargs)
context["honeypot_field_name"] = settings.HONEYPOT_FIELD_NAME
return context

The above code could be extended with the following form_valid method:

def form_valid(self, form):
    check_email_message = "Thanks for starting to register an account on our website. To complete your registration, please check your email for an message from us. You should have just received one. Please look in your spam / junk folder if our message is not in your inbox"
    # notice we use `self.request` here since the request is a member of the CustomRegistrationView instance
    messages.info(self.request, check_email_message)

    return super().form_valid(form)
@sim-codes
Copy link
Contributor

I want to work on this

@brylie
Copy link
Member

brylie commented Jun 8, 2024

@sim-codes, I've updated the issue description to include two tasks:

  • use Django messages to display a confirmation message directly on the website after the registration form is submitted
  • modify the registration confirmation email template

The related PR currently only contains the changes to the email template. So, we will need to also display instructions to check the registrants email on the website using the Django messages framework.

@brylie
Copy link
Member

brylie commented Jun 8, 2024

I've updated the issue description to contain the particular code to change. Please try the instructions/code in the new description and let me know if you encounter any difficulties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

3 participants