-
Notifications
You must be signed in to change notification settings - Fork 526
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
Adds ability to send user invitation emails from Account Overview #703
Adds ability to send user invitation emails from Account Overview #703
Conversation
|
||
@spec send_user_invitation_email_enabled? :: boolean() | ||
def send_user_invitation_email_enabled?() do | ||
case System.get_env("USER_INVITATION_EMAIL_ENABLED") do |
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.
nit: should we move this to config/runtime.exs
, and we could also use String.to_existing_atom
to cast boolean values. For example: https://github.com/plausible/analytics/blob/master/config/runtime.exs#L68
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 that's a great idea, but it doesn't seem to be very standard practice in the codebase. We should have a larger discussion about how we should handle environmental variables. FWIW I agree that we should consolidate them into config/runtime.exs
.
cc @reichert621
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.
yup, let's handle that consolidation in a separate PR 👍
account = Accounts.get_account!(account_id) | ||
Logger.info("Sending user invitation email to #{to_address}") | ||
|
||
ChatApi.Emails.send_user_invitation_email( |
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.
send_user_invitation_email
returns a deliver_result
that might contain {:error, binary()}
. Should we log the error when it gets returned?
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.
woohoooo 🎉 🚀 🔥
Description
Currently, the only way to invite a user to an account is to generate a an invite url from the Account Overview page, copy that url, and send it directly to the user. We can make this process a lot easier by allowing for account admins to input the user's email and letting us send the invitation url to provided user.
Note: there's a lot of duplicated logic, so I've added some todos. I'm going to address them as a follow-up to this diff, but I wanted to keep them separate to keep the size of this diff smaller.
Issue
#591
Screenshots
Video of invite flow
CleanShot.2021-04-02.at.16.48.11.mp4
Email when the sender has a name
Email when the sender doesn't have a name
Checklist
mix test
mix format