Loading Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/011-privacy-settings.patch RUN patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/014-add-mail-usage.patch # RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch Loading patches/015-email-mail-template.patch +67 −46 Original line number Diff line number Diff line --- /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-15 18:56:05 +++ /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-15 19:03:58 --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-18 11:18:20 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-11 11:18:22 @@ -242,6 +242,13 @@ $data['invitee_name'] = ($senderName ?: $sender); Loading @@ -14,7 +14,6 @@ $fromName = $this->imipService->getFrom($senderName, $this->defaults->getName()); $message = $this->mailer->createMessage() \ No newline at end of file @@ -262,7 +269,22 @@ $template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data); $template->addHeader(); Loading @@ -24,7 +23,7 @@ + if ( count($vEvent)>1) { + $this->imipService->addSubjectAndHeadingUpdated($template, $method, $data['invitee_name'], $data['meeting_title']); + } else { + $this->imipService->addSubjectAndHeading($template, $method, $data['invitee_name'], $data['meeting_title'], $isModified, $replyingAttendee); + $this->imipService->addSubjectAndHeading($template, $method, $data['invitee_name'], $data['meeting_title']); + } + if ($method === self::METHOD_CANCEL) { + $template->addHeadingBanner('#FFC2B9','#7D1000',$l10n->t('The invitation has been cancelled')); Loading @@ -39,12 +38,63 @@ $this->imipService->addBulletList($template, $vEvent, $data); // Only add response buttons to invitation requests: Fix Issue #11230 \ No newline at end of file --- /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-15 18:58:59 +++ /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-15 19:02:34 @@ -541,8 +541,13 @@ --- ./apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-18 11:40:39 +++ ./apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-18 13:47:17 @@ -444,6 +444,51 @@ } /** + * @param IEMailTemplate $template + * @param string $method + * @param string $sender + * @param string $summary + * @param string|null $partstat + */ + public function addSubjectAndHeadingUpdated(IEMailTemplate $template, + string $method, string $sender, string $summary, bool $isModified, ?Property $replyingAttendee = null): void { + if ($method === IMipPlugin::METHOD_CANCEL) { + // TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" + $template->setSubject($this->l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($this->l10n->t('"%1$s" has been canceled', [$summary])); + } elseif ($method === IMipPlugin::METHOD_REPLY) { + // TRANSLATORS Subject for email, when an invitation is replied to. Ex: "Re: {{Event Name}}" + $template->setSubject($this->l10n->t('Re: %1$s', [$summary])); + // Build the strings + $partstat = (isset($replyingAttendee)) ? $replyingAttendee->offsetGet('PARTSTAT') : null; + $partstat = ($partstat instanceof Parameter) ? $partstat->getValue() : null; + switch ($partstat) { + case 'ACCEPTED': + $template->addHeading($this->l10n->t('%1$s has accepted your invitation', [$sender])); + break; + case 'TENTATIVE': + $template->addHeading($this->l10n->t('%1$s has tentatively accepted your invitation', [$sender])); + break; + case 'DECLINED': + $template->addHeading($this->l10n->t('%1$s has declined your invitation', [$sender])); + break; + case null: + default: + $template->addHeading($this->l10n->t('%1$s has responded to your invitation', [$sender])); + break; + } + } elseif ($method === IMipPlugin::METHOD_REQUEST && $isModified) { + // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Invitation updated: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s updated the event "%2$s"', [$sender, $summary])); + } else { + // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation Updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s would like to invite you to "%2$s"', [$sender, $summary])); + } + } + + /** * @param string $path * @return string */ @@ -541,8 +586,14 @@ $this->getAbsoluteImagePath('caldav/time.png'), $data['meeting_when'], '', IMipPlugin::IMIP_INDENT); } if ($data['meeting_location'] !== '') { Loading @@ -53,6 +103,7 @@ + if(filter_var(trim($data['meeting_location']), FILTER_VALIDATE_URL)) { + $template->addBodyListItem($data['meeting_location_html'] ?? $data['meeting_location'], $this->l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'), $data['meeting_location'], '', IMipPlugin::IMIP_INDENT); + + } else { + $template->addBodyListItem($data['meeting_location_html'] ?? $data['meeting_location'], $this->l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'), $data['meeting_location'], '', IMipPlugin::IMIP_INDENT); Loading @@ -60,7 +111,7 @@ } if ($data['meeting_url'] !== '') { $template->addBodyListItem($data['meeting_url_html'] ?? $data['meeting_url'], $this->l10n->t('Link:'), @@ -637,7 +642,7 @@ @@ -637,7 +688,7 @@ * @param $token */ public function addResponseButtons(IEMailTemplate $template, $token) { Loading @@ -69,7 +120,7 @@ $this->l10n->t('Accept'), $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ 'token' => $token, @@ -645,20 +650,13 @@ @@ -645,20 +696,10 @@ $this->l10n->t('Decline'), $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ 'token' => $token, Loading @@ -78,9 +129,9 @@ + $this->l10n->t('MayBe'), + $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); } public function addMoreOptionsButton(IEMailTemplate $template, $token) { - } - - public function addMoreOptionsButton(IEMailTemplate $template, $token) { - $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ - 'token' => $token, - ]); Loading @@ -93,33 +144,3 @@ } public function getReplyingAttendee(Message $iTipMessage): ?Property { @@ -686,4 +684,29 @@ } return false; } + + /** + * @param IEMailTemplate $template + * @param string $method + * @param string $sender + * @param string $summary + * @param string|null $partstat + */ + public function addSubjectAndHeadingUpdated(IEMailTemplate $template, + string $method, string $sender, string $summary): void { + if ($method === IMipPlugin::METHOD_CANCEL) { + // TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" + $template->setSubject($this->l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($this->l10n->t('"%1$s" has been canceled', [$summary])); + } elseif ($method === IMipPlugin::METHOD_REPLY) { + // TRANSLATORS Subject for email, when an invitation is replied to. Ex: "Re: {{Event Name}}" + $template->setSubject($this->l10n->t('Re: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s has responded to your invitation', [$sender])); + } else { + // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation Updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s would like to invite you to "%2$s"', [$sender, $summary])); + } + } + } Loading
Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/011-privacy-settings.patch RUN patch -u ${BASE_DIR}/lib/private/Authentication/Token/PublicKeyTokenProvider.php -i ${TMP_PATCH_DIR}/013-revert-token-password-update.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/014-add-mail-usage.patch # RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/018-occ-user-setting.patch RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch Loading
patches/015-email-mail-template.patch +67 −46 Original line number Diff line number Diff line --- /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-15 18:56:05 +++ /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-15 19:03:58 --- ./apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 2024-03-18 11:18:20 +++ ./apps/dav/lib/CalDAV/Schedule/IMipPlugin-new.php 2024-03-11 11:18:22 @@ -242,6 +242,13 @@ $data['invitee_name'] = ($senderName ?: $sender); Loading @@ -14,7 +14,6 @@ $fromName = $this->imipService->getFrom($senderName, $this->defaults->getName()); $message = $this->mailer->createMessage() \ No newline at end of file @@ -262,7 +269,22 @@ $template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data); $template->addHeader(); Loading @@ -24,7 +23,7 @@ + if ( count($vEvent)>1) { + $this->imipService->addSubjectAndHeadingUpdated($template, $method, $data['invitee_name'], $data['meeting_title']); + } else { + $this->imipService->addSubjectAndHeading($template, $method, $data['invitee_name'], $data['meeting_title'], $isModified, $replyingAttendee); + $this->imipService->addSubjectAndHeading($template, $method, $data['invitee_name'], $data['meeting_title']); + } + if ($method === self::METHOD_CANCEL) { + $template->addHeadingBanner('#FFC2B9','#7D1000',$l10n->t('The invitation has been cancelled')); Loading @@ -39,12 +38,63 @@ $this->imipService->addBulletList($template, $vEvent, $data); // Only add response buttons to invitation requests: Fix Issue #11230 \ No newline at end of file --- /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-15 18:58:59 +++ /Users/ronak/Desktop/murena/git-nextcloud/ecloud_dev_example/volumes/nextcloud/html/apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-15 19:02:34 @@ -541,8 +541,13 @@ --- ./apps/dav/lib/CalDAV/Schedule/IMipService.php 2024-03-18 11:40:39 +++ ./apps/dav/lib/CalDAV/Schedule/IMipService-new.php 2024-03-18 13:47:17 @@ -444,6 +444,51 @@ } /** + * @param IEMailTemplate $template + * @param string $method + * @param string $sender + * @param string $summary + * @param string|null $partstat + */ + public function addSubjectAndHeadingUpdated(IEMailTemplate $template, + string $method, string $sender, string $summary, bool $isModified, ?Property $replyingAttendee = null): void { + if ($method === IMipPlugin::METHOD_CANCEL) { + // TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" + $template->setSubject($this->l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($this->l10n->t('"%1$s" has been canceled', [$summary])); + } elseif ($method === IMipPlugin::METHOD_REPLY) { + // TRANSLATORS Subject for email, when an invitation is replied to. Ex: "Re: {{Event Name}}" + $template->setSubject($this->l10n->t('Re: %1$s', [$summary])); + // Build the strings + $partstat = (isset($replyingAttendee)) ? $replyingAttendee->offsetGet('PARTSTAT') : null; + $partstat = ($partstat instanceof Parameter) ? $partstat->getValue() : null; + switch ($partstat) { + case 'ACCEPTED': + $template->addHeading($this->l10n->t('%1$s has accepted your invitation', [$sender])); + break; + case 'TENTATIVE': + $template->addHeading($this->l10n->t('%1$s has tentatively accepted your invitation', [$sender])); + break; + case 'DECLINED': + $template->addHeading($this->l10n->t('%1$s has declined your invitation', [$sender])); + break; + case null: + default: + $template->addHeading($this->l10n->t('%1$s has responded to your invitation', [$sender])); + break; + } + } elseif ($method === IMipPlugin::METHOD_REQUEST && $isModified) { + // TRANSLATORS Subject for email, when an invitation is updated. Ex: "Invitation updated: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s updated the event "%2$s"', [$sender, $summary])); + } else { + // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation Updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s would like to invite you to "%2$s"', [$sender, $summary])); + } + } + + /** * @param string $path * @return string */ @@ -541,8 +586,14 @@ $this->getAbsoluteImagePath('caldav/time.png'), $data['meeting_when'], '', IMipPlugin::IMIP_INDENT); } if ($data['meeting_location'] !== '') { Loading @@ -53,6 +103,7 @@ + if(filter_var(trim($data['meeting_location']), FILTER_VALIDATE_URL)) { + $template->addBodyListItem($data['meeting_location_html'] ?? $data['meeting_location'], $this->l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/videocall.png'), $data['meeting_location'], '', IMipPlugin::IMIP_INDENT); + + } else { + $template->addBodyListItem($data['meeting_location_html'] ?? $data['meeting_location'], $this->l10n->t('Location:'), + $this->getAbsoluteImagePath('caldav/location.png'), $data['meeting_location'], '', IMipPlugin::IMIP_INDENT); Loading @@ -60,7 +111,7 @@ } if ($data['meeting_url'] !== '') { $template->addBodyListItem($data['meeting_url_html'] ?? $data['meeting_url'], $this->l10n->t('Link:'), @@ -637,7 +642,7 @@ @@ -637,7 +688,7 @@ * @param $token */ public function addResponseButtons(IEMailTemplate $template, $token) { Loading @@ -69,7 +120,7 @@ $this->l10n->t('Accept'), $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.accept', [ 'token' => $token, @@ -645,20 +650,13 @@ @@ -645,20 +696,10 @@ $this->l10n->t('Decline'), $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.decline', [ 'token' => $token, Loading @@ -78,9 +129,9 @@ + $this->l10n->t('MayBe'), + $this->urlGenerator->getAbsoluteUrl('apps/calendar/invitation/tentative/'.$token) ); } public function addMoreOptionsButton(IEMailTemplate $template, $token) { - } - - public function addMoreOptionsButton(IEMailTemplate $template, $token) { - $moreOptionsURL = $this->urlGenerator->linkToRouteAbsolute('dav.invitation_response.options', [ - 'token' => $token, - ]); Loading @@ -93,33 +144,3 @@ } public function getReplyingAttendee(Message $iTipMessage): ?Property { @@ -686,4 +684,29 @@ } return false; } + + /** + * @param IEMailTemplate $template + * @param string $method + * @param string $sender + * @param string $summary + * @param string|null $partstat + */ + public function addSubjectAndHeadingUpdated(IEMailTemplate $template, + string $method, string $sender, string $summary): void { + if ($method === IMipPlugin::METHOD_CANCEL) { + // TRANSLATORS Subject for email, when an invitation is cancelled. Ex: "Cancelled: {{Event Name}}" + $template->setSubject($this->l10n->t('Cancelled: %1$s', [$summary])); + $template->addHeading($this->l10n->t('"%1$s" has been canceled', [$summary])); + } elseif ($method === IMipPlugin::METHOD_REPLY) { + // TRANSLATORS Subject for email, when an invitation is replied to. Ex: "Re: {{Event Name}}" + $template->setSubject($this->l10n->t('Re: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s has responded to your invitation', [$sender])); + } else { + // TRANSLATORS Subject for email, when an invitation is sent. Ex: "Invitation: {{Event Name}}" + $template->setSubject($this->l10n->t('Invitation Updated: %1$s', [$summary])); + $template->addHeading($this->l10n->t('%1$s would like to invite you to "%2$s"', [$sender, $summary])); + } + } + }