Keep a published rule when some invitation emails already went out, and only set Reply-To when the inviter address is a mailbox.
This commit is contained in:
1 parent
3c984e00c5
commit
ab6a0c807d
7 files changed
+161
-10
No files matched your search
+12
-7
@@ -205,9 +205,10 @@ export const POST = apiRoute(
|
||||
});
|
||||
|
||||
const origin = getPublicOrigin(request);
|
||||
try {
|
||||
for (const inv of invites) {
|
||||
const verifyUrl = stakeholderInviteVerifyUrl(origin, inv.token);
|
||||
let sent = 0;
|
||||
for (const inv of invites) {
|
||||
const verifyUrl = stakeholderInviteVerifyUrl(origin, inv.token);
|
||||
try {
|
||||
await sendRuleStakeholderInviteEmail({
|
||||
to: inv.email,
|
||||
verifyUrl,
|
||||
@@ -217,11 +218,15 @@ export const POST = apiRoute(
|
||||
summary,
|
||||
document,
|
||||
});
|
||||
sent += 1;
|
||||
} catch (err) {
|
||||
logRouteError("rules.publish", requestId, err, {
|
||||
phase: "sendRuleStakeholderInviteEmail",
|
||||
email: inv.email,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
logRouteError("rules.publish", requestId, err, {
|
||||
phase: "sendRuleStakeholderInviteEmail",
|
||||
});
|
||||
}
|
||||
if (sent === 0) {
|
||||
try {
|
||||
await prisma.publishedRule.delete({ where: { id: rule.id } });
|
||||
} catch (delErr) {
|
||||
|
||||
Reference in new issue
Block a user