Skip to content

Commit afca89e

Browse files
committed
Added reply_to functionality
1 parent 09ecb30 commit afca89e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

office365/directory/users/user.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def send_mail(
272272
to_recipients,
273273
cc_recipients=None,
274274
bcc_recipients=None,
275+
reply_to = None,
275276
save_to_sent_items=False,
276277
):
277278
# type: (str, str|ItemBody, List[str], List[str], List[str], bool) -> Message
@@ -282,6 +283,7 @@ def send_mail(
282283
:param list[str] to_recipients: The To: recipients for the message.
283284
:param list[str] cc_recipients: The CC: recipients for the message.
284285
:param list[str] bcc_recipients: The BCC: recipients for the message.
286+
:param list[str] reply_to: The Reply-To: : recipients for the reply to the message.
285287
:param bool save_to_sent_items: Indicates whether to save the message in Sent Items. Specify it only if
286288
the parameter is false; default is true
287289
"""
@@ -302,6 +304,11 @@ def send_mail(
302304
return_type.cc_recipients.add(Recipient.from_email(email))
303305
for email in cc_recipients
304306
]
307+
if reply_to is not None:
308+
[
309+
return_type.reply_to.add(Recipient.from_email(email))
310+
for email in reply_to
311+
]
305312

306313
payload = {"message": return_type, "saveToSentItems": save_to_sent_items}
307314
qry = ServiceOperationQuery(self, "sendmail", None, payload)

office365/outlook/mail/messages/message.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,14 @@ def cc_recipients(self):
407407
"ccRecipients", ClientValueCollection(Recipient)
408408
)
409409

410+
@property
411+
def reply_to(self):
412+
"""The replyTo: recipients for the reply to the message."""
413+
self._persist_changes("replyTo")
414+
return self.properties.setdefault(
415+
"replyTo", ClientValueCollection(Recipient)
416+
)
417+
410418
@property
411419
def sender(self):
412420
"""The account that is actually used to generate the message. In most cases, this value is the same as the

0 commit comments

Comments
 (0)