Send the invitation as a light letter that names the community, the inviter by email, and who can read the Rule.
This commit is contained in:
1 parent
70ceb73104
commit
727a92a9ac
14 files changed
+534
-26
No files matched your search
@@ -46,7 +46,7 @@ export const POST = apiRoute<RouteContext>(
|
||||
email: true,
|
||||
inviteTokenHash: true,
|
||||
inviteExpiresAt: true,
|
||||
rule: { select: { userId: true, title: true } },
|
||||
rule: { select: { userId: true, title: true, summary: true, document: true } },
|
||||
},
|
||||
});
|
||||
|
||||
@@ -93,9 +93,18 @@ export const POST = apiRoute<RouteContext>(
|
||||
},
|
||||
});
|
||||
|
||||
const verifyUrl = stakeholderInviteVerifyUrl(getPublicOrigin(request), token);
|
||||
const origin = getPublicOrigin(request);
|
||||
const verifyUrl = stakeholderInviteVerifyUrl(origin, token);
|
||||
try {
|
||||
await sendRuleStakeholderInviteEmail(row.email, verifyUrl, row.rule.title);
|
||||
await sendRuleStakeholderInviteEmail({
|
||||
to: row.email,
|
||||
verifyUrl,
|
||||
origin,
|
||||
communityName: row.rule.title,
|
||||
inviterEmail: user.email,
|
||||
summary: row.rule.summary,
|
||||
document: row.rule.document,
|
||||
});
|
||||
} catch (err) {
|
||||
logRouteError("rules.stakeholders.resend", requestId, err, {
|
||||
phase: "sendRuleStakeholderInviteEmail",
|
||||
|
||||
Reference in new issue
Block a user