aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-02-20 18:57:56 +0100
committerAnna Larch <anna@nextcloud.com>2023-02-21 14:37:11 +0100
commited708150760505cb3571c9f6fd257d1485f71eb7 (patch)
treeb47d2d820e643ef1bc65c8c8499aed2c759dc52f /lib/private
parent5fcb55a2a9653575eec1c9d3551d6a887a22b84f (diff)
downloadnextcloud-server-ed708150760505cb3571c9f6fd257d1485f71eb7.tar.gz
nextcloud-server-ed708150760505cb3571c9f6fd257d1485f71eb7.zip
Fix calendar emails to be outlook compatible
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Mail/Message.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/Mail/Message.php b/lib/private/Mail/Message.php
index 01beefcc6d6..35d6f96d33a 100644
--- a/lib/private/Mail/Message.php
+++ b/lib/private/Mail/Message.php
@@ -76,6 +76,22 @@ class Message implements IMessage {
}
/**
+ * Can be used to "attach content inline" as message parts with specific MIME type and encoding.
+ * {@inheritDoc}
+ * @since 26.0.0
+ */
+ public function attachInline(string $body, string $name, string $contentType = null): IMessage {
+ # To be sure this works with iCalendar messages, we encode with 8bit instead of
+ # quoted-printable encoding. We save the current encoder, replace the current
+ # encoder with an 8bit encoder and after we've finished, we reset the encoder
+ # to the previous one. Originally intended to be added after the message body,
+ # as it is curently unknown if all mail clients handle this properly if added
+ # before.
+ $this->symfonyEmail->embed($body, $name, $contentType);
+ return $this;
+ }
+
+ /**
* Converts the [['displayName' => 'email'], ['displayName2' => 'email2']] arrays to valid Adresses
*
* @param array $addresses Array of mail addresses