mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-01 16:43:08 +01:00
22 lines
633 B
Python
Executable File
22 lines
633 B
Python
Executable File
#!/usr/bin/env nix-shell
|
|
#! nix-shell -i python3 --packages python3 python312Packages.resend
|
|
|
|
import resend
|
|
import subprocess
|
|
|
|
resend.api_key = subprocess.run(
|
|
["kwallet-query", "-r", "resend_api_key", "default", "-f", "Passwords"],
|
|
capture_output=True,
|
|
text=True,
|
|
).stdout.strip("\n")
|
|
|
|
params: resend.Emails.SendParams = {
|
|
"from": "Borgmatic <onboarding@resend.dev>",
|
|
"to": ["hyperreal@fedoraproject.org"],
|
|
"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)
|