diff --git a/src/backend/src/services/EmailService.js b/src/backend/src/services/EmailService.js index 21ddfab1..a11bd18e 100644 --- a/src/backend/src/services/EmailService.js +++ b/src/backend/src/services/EmailService.js @@ -138,6 +138,10 @@ If this was not you, please contact support@puter.com immediately.
Hi there {{rusername}},
You've received a share from {{susername}} on Puter.
Go to puter.com to check it out.
+ {{#if message}} +The following message was included:
+{{message}}+ {{/if}}
Sincerely,
Puter
` @@ -148,6 +152,10 @@ If this was not you, please contact support@puter.com immediately.Hi there,
You've received a share from {{sender_name}} on Puter:
+ {{#if message}} +The following message was included:
+{{message}}+ {{/if}}
Sincerely,
Puter
` diff --git a/src/backend/src/structured/sequence/share.js b/src/backend/src/structured/sequence/share.js index c06f9252..31d9d1d4 100644 --- a/src/backend/src/structured/sequence/share.js +++ b/src/backend/src/structured/sequence/share.js @@ -538,6 +538,8 @@ module.exports = new Sequence([ })); } } + + const metadata = a.get('req').body.metadata || {}; svc_notification.notify(UsernameNotifSelector(username), { source: 'sharing', @@ -545,6 +547,7 @@ module.exports = new Sequence([ title: 'Files were shared with you!', template: 'file-shared-with-you', fields: { + metadata, username: actor.type.user.username, files, }, @@ -564,6 +567,7 @@ module.exports = new Sequence([ // link: // TODO: create a link to the shared file susername: actor.type.user.username, rusername: username, + message: metadata.message, }); result.recipients[recipient_item.i] = @@ -583,10 +587,12 @@ module.exports = new Sequence([ const email = recipient_item.value; // data that gets stored in the `data` column of the share + const metadata = a.get('req').body.metadata || {}; const data = { $: 'internal:share', $v: 'v0.0.0', permissions: [], + metadata, }; for ( const share_item of shares_work.list() ) { @@ -616,6 +622,7 @@ module.exports = new Sequence([ await svc_email.send_email({ email }, 'share_by_email', { link: email_link, sender_name: actor.type.user.username, + message: metadata.message, }); } },