You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# office365/outlook/mail/messages/message.pyclassMessage(OutlookItem):
# ...@propertydefbody(self):
"""The body of the message. It can be in HTML or text format."""returnself.properties.setdefault("body", ItemBody())
@body.setterdefbody(self, value):
# type: (str|ItemBody) -> None"""Sets the body of the message. It can be in HTML or text format."""ifnotisinstance(value, ItemBody):
value=ItemBody(value) # POINT OF INTERESTself.set_property("body", value)
At the point of interest, ItemBody is initialized without any method of passing content_type, making it almost impossible to send HTML email using the Message class. While a developer could certainly resort to monkey-patching, patching a complex library with various property setters is quite challenging. It may be beneficial to expose to the developer methods of changing the body's content_type, perhaps via a separate body_content_type property that changes self.body.content_type.
Additionally, such an implementation's option to change the content_type should be exposed in office365.directory.users.user.send_mail as that's the most frequently used email-sending function, as demonstrated in the examples.
The text was updated successfully, but these errors were encountered:
At the point of interest,
ItemBody
is initialized without any method of passingcontent_type
, making it almost impossible to send HTML email using theMessage
class. While a developer could certainly resort to monkey-patching, patching a complex library with various property setters is quite challenging. It may be beneficial to expose to the developer methods of changing thebody
'scontent_type
, perhaps via a separatebody_content_type
property that changesself.body.content_type
.Additionally, such an implementation's option to change the content_type should be exposed in
office365.directory.users.user.send_mail
as that's the most frequently used email-sending function, as demonstrated in the examples.The text was updated successfully, but these errors were encountered: