-
-
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
Fix calendar emails to be outlook compatible #12946
Changes from all commits
e5e3169
e60ba22
f32f400
904bead
71e628b
7db07e7
b1d4917
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -58,6 +58,26 @@ public function attach(IAttachment $attachment): IMessage { | |||||
return $this; | ||||||
} | ||||||
|
||||||
/** | ||||||
* @param $body: body of the mime part | ||||||
* @param $content-type = null: Mime Content-Type (e.g. text/plain or text/calendar) | ||||||
* @param $charset = null: Character Set (e.g. UTF-8) | ||||||
* @return $this | ||||||
* @since 16.0.0 | ||||||
*/ | ||||||
public function addPart($data, $content_type = null, $charset = null): IMessage { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# 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. | ||||||
$encoder = $this->swiftMessage->getEncoder(); | ||||||
$eightbit_encoder = new \Swift_Mime_ContentEncoder_PlainContentEncoder("8bit"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$this->swiftMessage->setEncoder($eightbit_encoder); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$this->swiftMessage->addPart($data, $content_type, $charset); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$this->swiftMessage->setEncoder($encoder); | ||||||
return $this; | ||||||
} | ||||||
|
||||||
/** | ||||||
* SwiftMailer does currently not work with IDN domains, this function therefore converts the domains | ||||||
* FIXME: Remove this once SwiftMailer supports IDN | ||||||
|
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.
The method here works different than
addPart
https://github.com/nextcloud/3rdparty/blob/da8e24b48079cec2f9c8be950f7b996bce172190/swiftmailer/swiftmailer/lib/classes/Swift/Message.php#L72 (from swiftmailer). I would prefer another name than becauseaddPart
from swiftmailer add a part with the current encoder while these method always uses 8bit encoder. I would addgetEncoder
andsetEncoder
and set the encoding fromIMipPlugin
but lets ask @nickvergessen first.