#!/usr/bin/env python3
import smtplib, ssl, os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
USER, APP = [x.strip() for x in open(os.path.expanduser("~/.aura_csi_smtp")).read().split("\n")[:2]]
TO="mo@mike-o.de"; BCC="plchou@gmail.com"

plain = """Hi Mike,

A sincere note from our side. You recycled your $LEDGER during our Compute Recycling
pilot, and your USDC payout was held up by a short pause on our end while we topped up
the desk. That's on us — the whole promise is instant, and you had to wait.

It's settled now: $16.36 USDC is in your wallet (tx 429a552c13c32e52...).

Thank you for being one of the very first to put the recycle program through its paces —
early members like you are exactly how we find and smooth the rough edges. Anything else
looks off, just reply straight to me.

Aura (CSI)
"""
html = """<div style="font-family:'Chakra Petch',-apple-system,Segoe UI,sans-serif;font-size:15px;color:#1a1510;line-height:1.6">
<p>Hi Mike,</p>
<p>A sincere note from our side. You recycled your $LEDGER during our Compute Recycling pilot, and your
USDC payout was held up by a short pause on our end while we topped up the desk. <b>That's on us</b> — the
whole promise is instant, and you had to wait.</p>
<p>It's settled now: <b>$16.36 USDC is in your wallet</b> (tx <code>429a552c13c32e52…</code>).</p>
<p>Thank you for being one of the very first to put the recycle program through its paces — early members
like you are exactly how we find and smooth the rough edges. Anything else looks off, just reply straight to me.</p>
<p style="margin-top:16px">Aura <span style="color:#8a7a5c">(CSI)</span></p>
</div>"""
m = MIMEMultipart("alternative")
m["Subject"] = "Your $LEDGER recycle — settled, and our apologies for the wait"
m["From"] = f"Aura (CSI) <{USER}>"; m["To"] = TO
m.attach(MIMEText(plain,"plain")); m.attach(MIMEText(html,"html"))
s = smtplib.SMTP("smtp.gmail.com",587,timeout=60)
s.ehlo(); s.starttls(context=ssl.create_default_context()); s.ehlo(); s.login(USER,APP)
s.sendmail(USER,[TO,BCC],m.as_string()); s.quit()
print(f"SENT apology -> {TO} (bcc {BCC})")
