Skip to content

Commit 2e81c78

Browse files
committed
add email sending
1 parent 510b991 commit 2e81c78

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

.github/sendgrid.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/weekly_clone_stats.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,23 @@ jobs:
5959
- name: Send custom email
6060
run: |
6161
ENCODED_AUTH=${{ secrets.SENDGRID_KEY }}
62+
FROM=${{ secrets.EMAIL_FROM }}
63+
TO=${{ secrets.EMAIL_TO }}
64+
COUNT=${{ steps.parse.outputs.count }}
65+
REPOSITORY=${{ github.repository }}
66+
UNIQUES=${{ steps.parse.outputs.uniques }}
6267
6368
curl -X POST https://api.sendgrid.com/v3/mail/send \
6469
-H "Authorization: Bearer $ENCODED_AUTH" \
6570
-H "Content-Type: application/json" \
6671
-d '{
6772
"personalizations": [{
68-
"to": [{"email": "mohamed.amine.hamdouni@corbado.com"}],
69-
"subject": "Hello from GitHub Actions"
73+
"to": [{"email": $TO}],
74+
"subject": "Weekly GitHub Clone Stats for $REPOSITORY"
7075
}],
71-
"from": {"email": "test@corbado.com"},
76+
"from": {"email": $FROM},
7277
"content": [{
7378
"type": "text/plain",
74-
"value": "This is a custom body sent using base64 auth."
79+
"value": "Hi there! Here are the clone stats for $REPOSITORY this week:\n\n🔁 Total Clones: $COUNT\n👤 Unique Cloners: $UNIQUES\n\n– GitHub Bot"
7580
}]
7681
}'

0 commit comments

Comments
 (0)