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

Add a Contact Us page (T201159) #211

Merged
merged 49 commits into from
Feb 7, 2019

Conversation

uyscuti-wiki
Copy link
Contributor

A very basic working model of the contact us page. Probably needs some more work before it can be merged, but this is all I've got on my own.

@Samwalton9
Copy link
Member

Nice! It's probably worth adding a test to ensure that the contact form fires an email correctly.

@uyscuti-wiki uyscuti-wiki changed the title Add a Contact Us page (T201159) Add a Contact Us page (T201159) WIP Jan 16, 2019
@uyscuti-wiki uyscuti-wiki changed the title Add a Contact Us page (T201159) WIP Add a Contact Us page (T201159) Jan 16, 2019
@uyscuti-wiki
Copy link
Contributor Author

Added a test case with my limited understanding of testing to trigger the email function linked to the contact us form.

@Samwalton9
Copy link
Member

Samwalton9 commented Jan 22, 2019

Looking good! Just a minor thing - "comtact" rather than "contact" :D

https://github.com/WikipediaLibrary/TWLight/pull/211/files#diff-e591183c0ca13c657d1ff08a1b13a093R359

@Samwalton9
Copy link
Member

Now up at https://twlight-staging.wmflabs.org/contact/ if you want to poke around. Seems to be working fine, except Aaron is frustrated because the boxes don't line up :D

Copy link
Member

@jsnshrmn jsnshrmn left a comment

Choose a reason for hiding this comment

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

This is mostly good. I do see a few issues though:

  • We haven't thought the UX for the email field all the way through. We present the form before sign-in with empty, required input fields. If the user isn't signed in, we then throw away their input for the email field after sign in. Maybe we could really rethink this part. Some ideas for discussion:
    • we remove this as an input field and simply use the email from the user profile directly. We basically set the email in the profile as a requirement, and give people a warning or redirect to fill that out if it's empty or invalid
    • we discuss what integrating with wiki talk might look like
    • we integrate with on wiki contact forms, eg https://meta.wikimedia.org/wiki/Special:EmailUser/username
    • something else?

@Samwalton9
Copy link
Member

If the user isn't signed in, we then throw away their input for the email field after sign in

This doesn't seem to be the case for me - if I click Submit while logged out, I get logged in and returned to the page with my form data intact.

@uyscuti-wiki
Copy link
Contributor Author

uyscuti-wiki commented Jan 24, 2019

I think Jason is referring to the use case where the user actually has their email in the platform which is written over their email field input after logging in? (assuming the two are different)

@Samwalton9
Copy link
Member

Oh, right - I see that, yep.

Honestly I like the first idea - we can display a 'you need to go set your email' message if they haven't set it.

@jsnshrmn
Copy link
Member

I think ideally we'd still display the email value (after sign in) as a locked/grey-out field (my recollection is that crispy makes this simple) with some help text stating that this comes from the profile.

@uyscuti-wiki
Copy link
Contributor Author

The email field no longer is directly editable by users, both logged in and not logged in.

@Samwalton9
Copy link
Member

@uyscuti-wiki Did you mean to make your last commit in this PR? Feels like its unrelated to the Contact page, unless I'm missing something.

@uyscuti-wiki
Copy link
Contributor Author

Not my wisest decision, but in a weird way I meant to. I got sidetracked following this line because users won't be able to update or delete their email after landing on their user profiles. What was supposed to be a single <a href=..> tag then turned out to be a task of its own, and I somehow thought everything belonged together.

I'll reset the branch to commit 7c4fcf5 and break out the last commit to a new branch and PR from there.

Copy link
Member

@jsnshrmn jsnshrmn left a comment

Choose a reason for hiding this comment

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

This is looking good! Some feedback:

  • we should change the email field into a piece display markup within the form instead of processed form input. Right now it's disabled, but all someone has to due is remove those flags with the dev tools in their browser (or do a curl -xPOST) and then they can submit whatever data they wish for the email field
  • we (maybe me?) should add the code for this to parse the email address from the user profile and do validation (e.g. kick the user back to the form with an error/warning as if they left a real form field empty/invalid)
  • we (probably me?) should add the code to cc the user or set their email address as the reply-to.

@uyscuti-wiki
Copy link
Contributor Author

uyscuti-wiki commented Jan 29, 2019

About the first point, I thought so too, until I came across this - Django won't let users tamper with the data. What am I missing here?

@jsnshrmn
Copy link
Member

@uyscuti-wiki I stand corrected on that point! You're not missing anything, this is Django doing the right thing! Since we're not actually using that email address anywhere yet, I couldn't actually see the parsed value. I just modified it and saw that it succeeded.

@jsnshrmn
Copy link
Member

@uyscuti-wiki Do you want to work on any more steps for this or would you like to hand off?

@uyscuti-wiki
Copy link
Contributor Author

Not yet. I'll give it a whirl, see if I get anywhere. On a related note, can you point me to documentation/guides (if any) on djmail? Thanks for asking.

@jsnshrmn
Copy link
Member

django email docs:
https://docs.djangoproject.com/en/1.11/topics/email/

djmail docs:
https://bameda.github.io/djmail/

Copy link
Member

@jsnshrmn jsnshrmn left a comment

Choose a reason for hiding this comment

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

See inline comments.

TWLight/emails/views.py Outdated Show resolved Hide resolved
Copy link
Member

@jsnshrmn jsnshrmn left a comment

Choose a reason for hiding this comment

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

This is great. Literally the only thing left is a slight tweak to the subject line. I added an inline suggestion. Once that's changed, we'll merge!

email subject tweak

Co-Authored-By: uyscuti-wiki <uyscuti-wiki@users.noreply.github.com>
@jsnshrmn jsnshrmn merged commit 3e3f2c6 into WikipediaLibrary:master Feb 7, 2019
@uyscuti-wiki
Copy link
Contributor Author

Thanks!

@uyscuti-wiki uyscuti-wiki deleted the contact-us branch September 26, 2019 06:43
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.

3 participants