Skip to content

Commit

Permalink
make recipients configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
siimsams committed Jul 27, 2023
1 parent 5633c63 commit 78b09b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- name: ✍️ Create .env file
run: |
echo '${{ secrets.RECAPTCHA }}' > ./dist/.env
echo '${{ vars.RECIPIENT }}' >> ./dist/.env
- name: 📂 Sync files
uses: SamKirkland/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion www/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
$response = $_POST['token'];

$formcontent=" Nimi: $name \n Telefon: $phone \n E-mail: $email \n Sõnum: \n $message";
$recipient = "[email protected]";
$subject = "Võimalik matk // $phone // $email";
$mailheader = "From: $email \r\n";

$env = parse_ini_file('.env');
$secret = $env["RECAPTCHA_SECRET"];
$recipient = $env["RECIPIENT"];


function validated($response, $secret) {
$url = "https://www.google.com/recaptcha/api/siteverify?secret=".$secret."&response=".$response;
Expand Down

0 comments on commit 78b09b8

Please sign in to comment.