mirror of
https://codeberg.org/hyperreal/bin
synced 2025-01-18 16:23:43 +01:00
25 lines
540 B
Python
Executable File
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)
|