-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Send invite over email if possible #2112
Conversation
Took a stab at the design (found here), @yakkomajuri may want to tweak the copy. |
That's fine by me @paolodamico |
Also added invite expiry after 3 days. Note: changed the default weight of email text to 400 (regular), since 300 (light) was too thin for copy. |
Great @Twixes, lmk if you want me to review now |
Yep, go ahead. |
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.
Looking good!
Some general UX suggestions,
- When creating an invite and email is not available, I think it's a better experience to just show the invite link (and allow copying to clipboard) immediately in that window. Think it's better to remove the invite link from the list table. If they lost the link, they can just create another one (seems pretty common behavior).
- Related to the above, I would add an "expires at" column.
- The social buttons on the
/signup/{invite}
page say "Sign in with GitHub", when it should be "Sign up ...". The new design just says "Continue with [provider]" to simplify things. - Maybe out-of-scope for this PR (feel free to open a separate issue if that's the case). When you open a link to an invalid invite (e.g. I created an invite link and then revoked it), you're redirected to the login. I believe a better user experience would be to get an error message saying the invite link you have is invalid or expired.
frontend/src/scenes/organization/Invites/CreateOrgInviteModal.tsx
Outdated
Show resolved
Hide resolved
<i>Invites emailed by PostHog coming soon.</i> | ||
{user?.are_invite_emails_available | ||
? 'PostHog will then email it to the address.' | ||
: "Since this PostHog instance isn't configured for emailing invites, remember to share the link!"} | ||
</p> | ||
<Input |
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.
Per the new design guidelines, use a label instead of the add-on and I also suggest adding a placeholder with an example email (maybe even using the domain from the current user? GQ)
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.
As an improvement, submitting the form with the enter key would be great.
""" | ||
return bool(settings.EMAIL_HOST) | ||
return bool(settings.EMAIL_HOST) and (not with_absolute_urls or settings.SITE_URL is not None) |
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.
I think all emails require absolute URLs to be available (at least all emails that call this method).
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.
Not sure what action you suggest here: always require SITE_URL?
posthog/templates/email/invite.html
Outdated
<strong>{{ invite.created_by.first_name }}</strong> ({{ invite.created_by.email }}) invited you to join organization {{ invite.organization.name }} on PostHog.<br/> | ||
PostHog is an open-source product analytics tool that will help you better understand your users. | ||
</p> | ||
<p><a class="button" href="{{ invite }}">Join {{ invite.organization.name }} Now</a></p> |
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.
Think the button centered would look better.
<div class="container"> | ||
<div class="section"> | ||
<h1>Join {{ invite.organization.name }} on PostHog</h1> | ||
<p> |
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.
I think adding the image from the design would look pretty cool.
Merge conflicts |
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.
Looks good! Made a few minor improvements,
- Adjusted copy for instructions and submit button on the invite modal
- Auto-focus the input when opening the modal and automatically copying link to clipboard if email is not sent.
- Allow submitting the email address with the Enter key & wrap up in a form for auto-capture to properly register this.
- Adjusted email styles and added hero image
Changes
This makes invites emailed to target email on creation. Resolves #1611.
A few considerations before merging:
Checklist