Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated libs #218

Merged
merged 7 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion fastapi_mail/fastmail.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from contextlib import contextmanager
from email.utils import formataddr
from email.message import EmailMessage, Message
from email.utils import formataddr
from typing import Any, Dict, Optional, Union

import blinker
Expand Down
9 changes: 2 additions & 7 deletions fastapi_mail/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate, make_msgid
from typing import Any, Optional, Union
from typing import Any, Union

from .schemas import MessageType, MultipartSubtypeEnum

Expand Down Expand Up @@ -107,9 +107,7 @@ def attach_alternative(self, message: MIMEMultipart) -> MIMEMultipart:
message.attach(tmpmsg)
return message

async def _message(
self, sender: Optional[str] = None
) -> Union[EmailMessage, Message]:
async def _message(self, sender: str) -> Union[EmailMessage, Message]:
"""
Creates the email message
"""
Expand Down Expand Up @@ -153,6 +151,3 @@ async def _message(
self.message.add_header(header_name, header_content)

return self.message

async def as_string(self) -> Union[EmailMessage, Message]:
return await self._message()
Loading
Loading