Skip to content

Commit

Permalink
Merge pull request #57 from gisce/fixes
Browse files Browse the repository at this point in the history
fixes MicrosoftGraphSender
  • Loading branch information
polsala authored Feb 24, 2025
2 parents 8ccdb4a + 9405f32 commit 8ae2822
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 8ae2822

Please sign in to comment.