-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add expiration date to share email #17379
Add expiration date to share email #17379
Conversation
I could not run phpunit test. Can someone point me out the documentation? |
https://docs.nextcloud.com/server/17/developer_manual/core/unit-testing.html |
2a6ab0d
to
322ca81
Compare
@kesselb thanks for the hand. I think that the test is fixed. If you have the chance to review the change 🙇♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution 🚀 Thank you 👍
@@ -405,6 +405,10 @@ protected function sendMailNotification($filename, | |||
$emailTemplate->addHeader(); | |||
$emailTemplate->addHeading($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false); | |||
$text = $this->l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]); | |||
if ($expiration) { | |||
$relativeDate = (string)$expiration->diff(new \DateTime('now'))->format("%a"); | |||
$text .= ' ' . $this->l->t('It will expire in %1$s days.', [$relativeDate]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Don't know much about UX but I think we should make this easier to understand.
Example:
A) You are able to access this file until xyz.
B) For security the share is only valid for x days. It's not possible to access the data after: xzy.
Let's ask @jancborchardt and @jospoortvliet for help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would be good to make this expiration info a second paragraph below the other one so that it’s clearly separated. (Also the sentence "Click the button below" can really be cut …)
This share will expire in 5 days, on October 30 at 12:00 UTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise this pull request seems good! Yes we can improve a lot on the design and should do that – @RageZBla your call if you want to do more here. :) (E.g. the triplication of subject, title and first sentence of the content.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, my comment above still stands. :) Also, it would be nice to handle singular correctly cause it looks weird if "this share will expire in 1 days". ;)
Hey! Thanks for this! |
@skjnldsv is it possible that "set default expiration date" (from the sharing settings) is not used by the sharebymail app? |
@kesselb the expiration date enforce is only for share links! :) |
Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com>
Co-Authored-By: Daniel Kesselberg <mail@danielkesselberg.de> Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com>
Co-Authored-By: Daniel Kesselberg <mail@danielkesselberg.de> Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com>
2fa4042
to
fff5511
Compare
How can I set an expiration date then? ;) |
In any sharing? It will just not be enforced :) |
Hmm. I'm creating a new share by entering my email. Hit enter. I receive the share notification email. For this feature we need a expiration date before the share notification is sent? |
@kesselb sharing with a user with an email should work as well. |
ah yes, I guess it doesn't send another email after you set the expiration date. |
@skjnldsv thanks 👍
In the meantime I used above to set test this email 😆 |
A bit more easier from the console @kesselb $.post("/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json", {
shareType: 4,
shareWith: 'email@domain.ext',
permissions: 27,
path: '/welcome.txt',
expireDate: '24-10-2019'
}) |
So, the issue is that this is not always there as the file is already shared right away. |
As there is no feedback since a while I will close this ticket. Thanks for the interest in Nextcloud and the effort put into this! 🙇 |
Fixes #15680