Skip to content

Commit 9326786

Browse files
author
Alejandro Casanovas
committed
Fix googleapis#183 When trying to send a message that is a saved draft and has uncommitted changes, call save draft before sending.
1 parent 88e1059 commit 9326786

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

O365/message.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,11 @@ def send(self, save_to_sent_folder=True):
602602
if self.__is_draft and self.object_id:
603603
url = self.build_url(
604604
self._endpoints.get('send_draft').format(id=self.object_id))
605+
if self._track_changes:
606+
# there are pending changes to be committed
607+
self.save_draft()
605608
data = None
609+
606610
else:
607611
url = self.build_url(self._endpoints.get('send_mail'))
608612
data = {self._cc('message'): self.to_api_data()}

0 commit comments

Comments
 (0)