bin/resend_borg_error.py

25 lines
540 B
Python
Executable File

# /// script
# dependencies = [
# "resend",
# ]
# ///
import subprocess
from pathlib import Path
import resend
resend.api_key = (
Path("/usr/local/etc/resend_api_key.txt").read_text().strip("\n")
)
params: resend.Emails.SendParams = {
"from": "Borgmatic <admin@hyperreal.coffee>",
"to": ["hyperreal@moonshadow.dev"],
"subject": "[moonshadow] Error running Borgmatic",
"text": "There was an error running your Borgmatic backup on moonshadow. Please investigate.",
}
email = resend.Emails.send(params)
print(email)