Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from datetime import datetime
import boto3
import pytz

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por conta da layer, eu acho que vamos ter problemas com o pacote do pytz, quer dar deploy e testar ou trocar por uma utilziação sem o pytz?

ele só seta o valor do delta no datetime, ele abstrai isso

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o que você acha que vale mais a pena Soller ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seta na mao o timezone


from .entities.email import Email
from src.shared.helpers.external_interfaces.http_lambda_requests import LambdaHttpRequest, LambdaHttpResponse
Expand Down Expand Up @@ -48,12 +49,14 @@ def send_email(event, context):
],
Source=os.environ.get("FROM_EMAIL"),
)
date_time = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
br_timezone = pytz.timezone("America/Sao_Paulo")
date_time = datetime.now(br_timezone).strftime("%d/%m/%Y %H:%M:%S")

status_code = 200
response = f"Email enviado com sucesso para {user_email} em {date_time}"
except Exception as e:
status_code = 500
date_time = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
date_time = datetime.now(br_timezone).strftime("%d/%m/%Y %H:%M:%S")
response = f"Erro ao enviar email para {user_email} em {date_time} - {e}"

http_response = LambdaHttpResponse(status_code=status_code, body=response)
Expand Down