Skip to content
Open
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
85 changes: 85 additions & 0 deletions mail_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Invitation</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 0;
}
.container {
width: 100%;
max-width: 600px;
margin: 20px auto;
background-color: #fff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.header {
text-align: center;
color: #1e90ff;
}
.header h1 {
margin: 0;
}
.event-details {
margin: 20px 0;
font-size: 16px;
}
.event-details p {
margin: 8px 0;
}
.cta {
text-align: center;
margin-top: 20px;
}
.cta a {
background-color: #1e90ff;
color: white;
padding: 10px 20px;
text-decoration: none;
font-size: 16px;
border-radius: 5px;
}
.footer {
text-align: center;
font-size: 12px;
color: #888;
margin-top: 30px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>You're Invited!</h1>
<p>[Event Name] on [Event Date]</p>
</div>
<div class="event-details">
<p>Dear [Recipient's Name],</p>
<p>I hope this message finds you well! We are excited to invite you to [Event Name] on [Event Date] at [Event Location/Online Platform].</p>
<p><strong>Event Details:</strong></p>
<ul>
<li><strong>Date:</strong> [Event Date]</li>
<li><strong>Time:</strong> [Event Time]</li>
<li><strong>Location:</strong> [Event Location / Online Link]</li>
<li><strong>RSVP:</strong> Please confirm your attendance by [RSVP Date] via [RSVP Method].</li>
</ul>
<p>We would love to have you join us and look forward to your presence at this special event.</p>
<p>If you have any questions or need additional information, feel free to reach out.</p>
</div>
<div class="cta">
<a href="[RSVP Link]">RSVP Now</a>
</div>
<div class="footer">
<p>Best regards,<br>[Your Name]<br>[Your Position]<br>[Your Organization]</p>
</div>
</div>
</body>
</html>
8 changes: 6 additions & 2 deletions src/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@

if __name__ == "__main__":
subject = "Test Email"
body = "This is a test email sent from Python!"

to_emails = ["ertugrul.a.senturk@gmail.com"] * 10
try:
with open("mail_template.html") as body_file:
body = body_file.read()
except Exception as e:
print("Could not open mail body file: ", e)
exit(1)

apply_log_config()

Expand Down
3 changes: 2 additions & 1 deletion src/services/email_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def send_emails(smtp_server: str, smtp_port: int, username: str, password: str,
msg['Subject'] = subject

# Attach the email body
msg.attach(MIMEText(body, 'plain'))
msg.attach(MIMEText(body, 'html'))

try:
server.send_message(msg)
print(f"Email sent to {to_email}")
Expand Down