Skip to content

Commit

Permalink
feat: fix imports and email utils usage
Browse files Browse the repository at this point in the history
  • Loading branch information
montoyaobeso committed Jun 4, 2024
1 parent 645e0ff commit 9c78e09
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
from src.app.email.content_builder import get_email_body
from src.app.email.sender import SendEmailService
from src.app.email.content_builder import EmailBodyBuilder
from src.app.email.sender import EmailSender

import src.app.exceptions as app_exceptions
import pandas as pd
Expand Down Expand Up @@ -62,20 +62,22 @@ def main():
tp = TransactionsProcessor(df)

# Get email body
email_body = get_email_body(
body_builder = EmailBodyBuilder(
client_name=args.client_name,
total_balance=tp.get_balance(),
avg_credit_amount=tp.get_avg_credit_amount(),
avg_debit_amount=tp.get_avg_debit_amount(),
transactions_per_month=tp.get_montly_transactions(),
)

SendEmailService().send_email(
email_sender = EmailSender(
subject=args.subject,
recipient=args.recipient,
body_content=email_body,
body_content=body_builder.get_email_body(),
)

email_sender.send_email()

print("Email send succesfully.")


Expand Down

0 comments on commit 9c78e09

Please sign in to comment.