Skip to content

Commit e8206a6

Browse files
committed
ChangedGithubActions
1 parent 46dbf85 commit e8206a6

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/playwright.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,40 @@ jobs:
5555
# This step should always run, even if previous steps fail
5656
if: always()
5757

58-
# Step to send email with the zip report
58+
# Step to send email with the zip report using SendGrid API
5959
- name: Send email with zip report
6060
run: |
61-
echo "Sending email with zip report"
62-
echo "This is the body of the email" | mutt -s "Subject: Playwright Test Report" -a html-report.zip codendeavor@gmail.com
61+
curl -X "POST" "https://api.sendgrid.com/v3/mail/send" \
62+
-H 'Authorization: Bearer YOUR_SENDGRID_API_KEY' \
63+
-H 'Content-Type: application/json' \
64+
-d $'{
65+
"personalizations": [
66+
{
67+
"to": [
68+
{
69+
"email": "recipient@example.com"
70+
}
71+
],
72+
"subject": "Playwright Test Report"
73+
}
74+
],
75+
"from": {
76+
"email": "sender@example.com"
77+
},
78+
"content": [
79+
{
80+
"type": "text/plain",
81+
"value": "This is the body of the email."
82+
}
83+
],
84+
"attachments": [
85+
{
86+
"content": "'"$(base64 html-report.zip)"'",
87+
"filename": "html-report.zip",
88+
"type": "application/zip",
89+
"disposition": "attachment"
90+
}
91+
]
92+
}'
6393
# This step should only run if the previous steps were successful
6494
if: success()

0 commit comments

Comments
 (0)