#!/bin/bash
# Send morning briefing via Gmail SMTP
set -e

# Load env vars from dedicated file
ENV_FILE="/home/thesage/.hermes/.env"
if [ -f "$ENV_FILE" ]; then
    set -a
    source "$ENV_FILE"
    set +a
fi

# Fallback to user profile
if [ -f ~/.bashrc ]; then source ~/.bashrc > /dev/null 2>&1; fi
if [ -f ~/.zshrc ]; then source ~/.zshrc > /dev/null 2>&1; fi
if [ -f ~/.profile ]; then source ~/.profile > /dev/null 2>&1; fi

# Run the email sender (Apple iCloud SMTP)
python3 /home/thesage/.hermes/scripts/send_briefing_apple_email.py
