Send an email

This commit is contained in:
richard-dds
2018-11-12 14:05:20 -05:00
parent 2f1970e93b
commit 016116c9cc
3 changed files with 27 additions and 1 deletions

View File

@@ -81,3 +81,7 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
def workspace(self):
if self.workspace_role:
return self.workspace_role.workspace
@property
def user_email(self):
return self.workspace_role.user.email

View File

@@ -378,5 +378,8 @@ def revoke_invitation(workspace_id, token):
@bp.route("/workspaces/<workspace_id>/invitations/<token>/resend", methods=["POST"])
def resend_invitation(workspace_id, token):
Invitations.resend(g.current_user, workspace_id, token)
invite = Invitations.resend(g.current_user, workspace_id, token)
send_invite_email(
g.current_user.full_name, invite.token, invite.user_email
)
return redirect(url_for("workspaces.workspace_members", workspace_id=workspace_id))