mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(ShareAPI): Send mails for mail shares by default
It looks like, the frontend it needs to provide the `sendMail` param for the backend to decide wether mails would be sent. Our UI does not have that at the moment so it should default to sending emails always for mail shares. Not exactly sure how this was handled earlier but this is a good starting point. Resolves : https://github.com/nextcloud/server/issues/48012 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
e200099f82
commit
0f2013d24f
1 changed files with 10 additions and 1 deletions
|
|
@ -658,7 +658,16 @@ class ShareAPIController extends OCSController {
|
|||
$this->checkInheritedAttributes($share);
|
||||
|
||||
// Handle mail send
|
||||
if ($sendMail === 'true' || $sendMail === 'false') {
|
||||
if (is_null($sendMail)) {
|
||||
// Define a default behavior when sendMail is not provided
|
||||
if ($shareType === IShare::TYPE_EMAIL && strlen($shareWith) !== 0) {
|
||||
// For email shares, the default is to send the mail
|
||||
$share->setMailSend(true);
|
||||
} else {
|
||||
// For all other share types, the default is to not send the mail
|
||||
$share->setMailSend(false);
|
||||
}
|
||||
} else {
|
||||
$share->setMailSend($sendMail === 'true');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue