Skip to content

Commit

Permalink
Update daily digest email content with new date, quote, weather locat…
Browse files Browse the repository at this point in the history
…ion, and Wikipedia fact; modify recipient handling for multiple emails
  • Loading branch information
Wambaforestin committed Dec 9, 2024
1 parent 5ba2f16 commit cde2416
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
16 changes: 8 additions & 8 deletions start_your_day/backend/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Daily Digest - 09 December 2024</title>
<title>Daily Digest - 10 December 2024</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<style>
body {
Expand Down Expand Up @@ -54,32 +54,32 @@
<div class="container">
<h1>🌞 Daily Digest</h1>
<p style="text-align: center; color: #7f8c8d;">
09 December 2024
10 December 2024
</p>


<div class="section quote">
<h2>📜 Quote of the Day</h2>
<blockquote>
<i> I do wish we could chat longer, but I'm having an old friend for dinner.</i>
<footer>Anthony Hopkins, The Silence of the Lambs, </footer>
<i> Every champion was once a contender that refused to give up.</i>
<footer>Sylvester Stallone, Rocky, </footer>
</blockquote>
</div>


<div class="section weather">
<h2>🌦️ Weather Forecast</h2>
<p><strong>Location:</strong> Franconville, FR</p>
<p><strong>Location:</strong> Le Plessis-Bouchard, FR</p>
<ul>
<li>2024-12-09 07:00:00: Overcast Clouds, 5.74°C</li><li>2024-12-09 10:00:00: Overcast Clouds, 5.6°C</li><li>2024-12-09 13:00:00: Overcast Clouds, 5.78°C</li><li>2024-12-09 16:00:00: Light Rain, 5.91°C</li><li>2024-12-09 19:00:00: Light Rain, 4.53°C</li><li>2024-12-09 22:00:00: Light Rain, 4.74°C</li><li>2024-12-10 01:00:00: Light Rain, 5.08°C</li><li>2024-12-10 04:00:00: Overcast Clouds, 4.53°C</li><li>2024-12-10 07:00:00: Overcast Clouds, 4.63°C</li>
<li>2024-12-10 01:00:00: Overcast Clouds, 5.53°C</li><li>2024-12-10 04:00:00: Overcast Clouds, 5.32°C</li><li>2024-12-10 07:00:00: Overcast Clouds, 5.06°C</li><li>2024-12-10 10:00:00: Light Rain, 5.43°C</li><li>2024-12-10 13:00:00: Overcast Clouds, 5.41°C</li><li>2024-12-10 16:00:00: Overcast Clouds, 5.81°C</li><li>2024-12-10 19:00:00: Overcast Clouds, 5.4°C</li><li>2024-12-10 22:00:00: Overcast Clouds, 5.07°C</li><li>2024-12-11 01:00:00: Overcast Clouds, 4.8°C</li>
</ul>
</div>


<div class="section wikipedia">
<h2>🧠 Did You Know?</h2>
<p>Sarah Millicent Hermione Touchet-Jesson, Baroness Audley, was an English actress and dancer and a daughter of Winston Churchill.</p>
<p><em>Source: <a href="https://en.wikipedia.org/wiki/Sarah_Churchill_(actress)">https://en.wikipedia.org/wiki/Sarah_Churchill_(actress)</a></em></p>
<p>Ostenia is a genus of flies in the family Dolichopodidae. It contains only one species, Ostenia robusta, which is endemic to New Zealand. The species was first described by Frederick Hutton in 1901, and the genus was named after Carl Robert Osten-Sacken.</p>
<p><em>Source: <a href="https://en.wikipedia.org/wiki/Ostenia">https://en.wikipedia.org/wiki/Ostenia</a></em></p>
</div>

<div class="footer">
Expand Down
30 changes: 15 additions & 15 deletions start_your_day/backend/email.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
🌞 Daily Digest - 09 December 2024 🌞
🌞 Daily Digest - 10 December 2024 🌞
==================================================

📜 Quote of the Day 📜
-------------------------
I do wish we could chat longer, but I'm having an old friend for dinner.❞
- Anthony Hopkins, The Silence of the Lambs,
Every champion was once a contender that refused to give up.❞
- Sylvester Stallone, Rocky,

🌦️ Weather Forecast: Franconville, FR 🌦️
🌦️ Weather Forecast: Le Plessis-Bouchard, FR 🌦️
--------------------------------------------------
• 2024-12-09 07:00:00: Overcast Clouds | 5.74°C
• 2024-12-09 10:00:00: Overcast Clouds | 5.6°C
• 2024-12-09 13:00:00: Overcast Clouds | 5.78°C
• 2024-12-09 16:00:00: Light Rain | 5.91°C
• 2024-12-09 19:00:00: Light Rain | 4.53°C
• 2024-12-09 22:00:00: Light Rain | 4.74°C
• 2024-12-10 01:00:00: Light Rain | 5.08°C
• 2024-12-10 04:00:00: Overcast Clouds | 4.53°C
• 2024-12-10 07:00:00: Overcast Clouds | 4.63°C
• 2024-12-10 01:00:00: Overcast Clouds | 5.53°C
• 2024-12-10 04:00:00: Overcast Clouds | 5.32°C
• 2024-12-10 07:00:00: Overcast Clouds | 5.06°C
• 2024-12-10 10:00:00: Light Rain | 5.43°C
• 2024-12-10 13:00:00: Overcast Clouds | 5.41°C
• 2024-12-10 16:00:00: Overcast Clouds | 5.81°C
• 2024-12-10 19:00:00: Overcast Clouds | 5.4°C
• 2024-12-10 22:00:00: Overcast Clouds | 5.07°C
• 2024-12-11 01:00:00: Overcast Clouds | 4.8°C

🧠 Did You Know? 🧠
-------------------------
Sarah Millicent Hermione Touchet-Jesson, Baroness Audley, was an English actress and dancer and a daughter of Winston Churchill.
(Source: https://en.wikipedia.org/wiki/Sarah_Churchill_(actress))
Ostenia is a genus of flies in the family Dolichopodidae. It contains only one species, Ostenia robusta, which is endemic to New Zealand. The species was first described by Frederick Hutton in 1901, and the genus was named after Carl Robert Osten-Sacken.
(Source: https://en.wikipedia.org/wiki/Ostenia)

✨ Have a Fantastic Day! ✨
5 changes: 3 additions & 2 deletions start_your_day/backend/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def __init__(self):
}

self.recipient_list = {
"email": os.getenv('RECIPIENT_EMAIL') # Get the recipient email address from environment variables
"email1": os.getenv('RECIPIENT_EMAIL1'), # Get the recipient email address from environment variables
"email2": os.getenv('RECIPIENT_EMAIL2') # Get the recipient email address from environment variables
}

self.sender_credentials = {
Expand Down Expand Up @@ -166,7 +167,7 @@ def send_email(self):
message = EmailMessage()
message['Subject'] = f"🌞 Daily Digest - {datetime.datetime.now().strftime('%d %B %Y')} 🌞"
message['From'] = self.sender_credentials['email']
message['To'] = self.recipient_list['email']
message['To'] = ', '.join(self.recipient_list.values()) # since we have multiple recipients, we join them with a comma

# Add plain text and HTML content
message_body_text, message_body_html = self.format_email()
Expand Down

0 comments on commit cde2416

Please sign in to comment.