Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes MicrosoftGraphSender
  • Loading branch information
polsala committed Feb 24, 2025
commit 9405f32392c4c7f35e5b1f97b981b5a68bdb8177
5 changes: 3 additions & 2 deletions qreu/sendcontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(self, client_id, client_secret, tenant_id, email_address):
:param email_address: Email address used for sending
:type email_address: str
"""
super(GraphSender, self).__init__(
super(MicrosoftGraphSender, self).__init__(
_client_id=client_id, _client_secret=client_secret,
_tenant_id=tenant_id, _email_address=email_address
)
Expand All @@ -165,14 +165,15 @@ def __enter__(self):
else:
raise Exception("Failed to acquire token: {0}".format(result.get("error_description", result)))

return super(GraphSender, self).__enter__()
return super(MicrosoftGraphSender, self).__enter__()

def sendmail(self, mail):
"""
Send the qreu.Email object through Microsoft Graph API.
:param mail: qreu.Email object to send
:type mail: Email
"""
import requests
from_mail = mail.from_
if isinstance(mail.from_, Address):
from_mail = from_mail.address
Expand Down
Loading