pull/21011/head
André de Matteo 11 months ago
parent e42c0b64f1
commit 55f7404763

@ -668,6 +668,7 @@ class MailConfig(BaseSettings):
default=None, default=None,
) )
class RagEtlConfig(BaseSettings): class RagEtlConfig(BaseSettings):
""" """
Configuration for RAG ETL processes Configuration for RAG ETL processes

@ -1,15 +1,12 @@
import logging import logging
import sendgrid import sendgrid # type: ignore
from python_http_client.exceptions import ForbiddenError, UnauthorizedError from python_http_client.exceptions import ForbiddenError, UnauthorizedError
from sendgrid.helpers.mail import Content, Email, Mail, To from sendgrid.helpers.mail import Content, Email, Mail, To # type: ignore
class SendGridClient: class SendGridClient:
def __init__( def __init__(self, sendgrid_api_key: str, _from: str):
self, sendgrid_api_key: str,_from: str
):
self.sendgrid_api_key = sendgrid_api_key self.sendgrid_api_key = sendgrid_api_key
self._from = _from self._from = _from
@ -28,7 +25,7 @@ class SendGridClient:
subject = mail["subject"] subject = mail["subject"]
content = Content("text/html", mail["html"]) content = Content("text/html", mail["html"])
mail = Mail(from_email, to_email, subject, content) mail = Mail(from_email, to_email, subject, content)
mail_json = mail.get() mail_json = mail.get() # type: ignore
response = sg.client.mail.send.post(request_body=mail_json) response = sg.client.mail.send.post(request_body=mail_json)
logging.debug(response.status_code) logging.debug(response.status_code)
logging.debug(response.body) logging.debug(response.body)

@ -18,4 +18,3 @@ ignore_missing_imports=True
[mypy-flask_restful.inputs] [mypy-flask_restful.inputs]
ignore_missing_imports=True ignore_missing_imports=True

Loading…
Cancel
Save