Skip to content

Commit ade92de

Browse files
committed
add email send on the webhook
1 parent 2486865 commit ade92de

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"BT_PRIVATE_KEY": {
2424
"description": "Your Braintree Private Key",
2525
"required": true
26+
},
27+
"EMAIL": {
28+
"description": "Email where to send the webhook message",
29+
"required": true
2630
}
2731
}
2832
}

public_html/webhook.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$message .= $webhookNotification->timestamp->format('D M j G:i:s T Y'); // "Sun Jan 1 00:00:00 UTC 2012"
1717

1818
error_log($message);
19+
mail(getenv('EMAIL'), $message, json_encode($webhookNotification));
1920

2021
header("HTTP/1.1 200 OK");
2122
}

0 commit comments

Comments
 (0)