Skip to content

Commit 2336a62

Browse files
committed
fix: share only emails email_confirmed recipients
1 parent 63efee3 commit 2336a62

File tree

1 file changed

+10
-8
lines changed
  • src/backend/src/structured/sequence

1 file changed

+10
-8
lines changed

src/backend/src/structured/sequence/share.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ module.exports = new Sequence([
194194
// Working on notifications
195195
// Email should have a link to a shared file, right?
196196
// .. how do I make those URLs? (gui feature)
197-
await svc_email.send_email({
198-
email: recipient_item.user.email,
199-
}, 'share_by_username', {
200-
// link: // TODO: create a link to the shared file
201-
susername: actor.type.user.username,
202-
rusername: username,
203-
message: metadata.message,
204-
});
197+
if ( recipient_item.user.email && recipient_item.user.email_confirmed ) {
198+
await svc_email.send_email({
199+
email: recipient_item.user.email,
200+
}, 'share_by_username', {
201+
// link: // TODO: create a link to the shared file
202+
susername: actor.type.user.username,
203+
rusername: username,
204+
message: metadata.message,
205+
});
206+
}
205207

206208
result.recipients[recipient_item.i] =
207209
{ $: 'api:status-report', status: 'success' };

0 commit comments

Comments
 (0)