mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 22:40:20 +08:00
dev: add share metadata and messages
This commit is contained in:
parent
9dff04f8d5
commit
e6986d5216
@ -138,6 +138,10 @@ If this was not you, please contact support@puter.com immediately.
|
||||
<p>Hi there {{rusername}},</p>
|
||||
<p>You've received a share from {{susername}} on Puter.</p>
|
||||
<p>Go to puter.com to check it out.</p>
|
||||
{{#if message}}
|
||||
<p>The following message was included:</p>
|
||||
<blockquote>{{message}}</blockquote>
|
||||
{{/if}}
|
||||
<p>Sincerely,</p>
|
||||
<p>Puter</p>
|
||||
`
|
||||
@ -148,6 +152,10 @@ If this was not you, please contact support@puter.com immediately.
|
||||
<p>Hi there,</p>
|
||||
<p>You've received a share from {{sender_name}} on Puter:</p>
|
||||
<p><a href="{{link}}">{{link}}</a></p>
|
||||
{{#if message}}
|
||||
<p>The following message was included:</p>
|
||||
<blockquote>{{message}}</blockquote>
|
||||
{{/if}}
|
||||
<p>Sincerely,</p>
|
||||
<p>Puter</p>
|
||||
`
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user