Added Discord Webhook function

This commit is contained in:
phil 2023-05-23 19:23:39 +01:00
parent 442af2b02d
commit 4cfaf71b06

View File

@ -7,6 +7,9 @@ domains=$(cat /LOCATION/OF/domains.txt)
sender_email="SENDER_NAME"
receiver_email="RECEIVER_EMAIL"
# Discord Webhook
WEBHOOK_URL="WEBHOOK_URL"
# Initialize an empty array to store the expiring domains and their days left
expiring_domains=()
@ -44,5 +47,8 @@ if [ ${#expiring_domains[@]} -gt 0 ]; then
# Send the email
echo -e "$body" | mail -s "$subject" -a "From: $sender_email" "$receiver_email"
curl -H "Content-Type: application/json" -X POST --data "{\"content\": null, \"embeds\": [{\"title\": \"$subject\", \"description\": \"$body\", \"color\": null}], \"attachments\": []}" $WEBHOOK_URL
fi