Skip to content

A live bird collage card for your Home Assistant dashboard.

adding birdweather request email template for now

mcguirepr896282b84ddaaa
diff --git a/scripts/birdweather_request.php b/scripts/birdweather_request.php
new file mode 100644
index 00000000..b52c0445
--- /dev/null
+++ b/scripts/birdweather_request.php
@@ -0,0 +1,15 @@
+<?php
+if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
+ $config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');
+} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {
+ $config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
+}
+$template = file_get_contents("email_template.html");
+
+foreach($config as $key => $value)
+{
+ $template = str_replace('{{ '.$key.' }}', $value, $template);
+}
+echo $template;
+?>
+
diff --git a/scripts/config.php b/scripts/config.php
index 82c61652..1b2504b5 100644
--- a/scripts/config.php
+++ b/scripts/config.php
@@ -120,6 +120,7 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
<input name="longitude" type="number" max="180" min="-180" step="0.0001" value="<?php print($config['LONGITUDE']);?>" required/><br>
<label for="birdweather_id">BirdWeather ID: </label>
<input name="birdweather_id" type="text" value="<?php print($config['BIRDWEATHER_ID']);?>" /><br>
+ <p><a href="mailto:[email protected]?subject=Request%20BirdWeather%20ID&body=<?php include('birdweather_request.php'); ?>" target="top">Email Tim</a> to request a BirdWeather ID</p>
<label for="pushed_app_key">Pushed App Key: </label>
<input name="pushed_app_key" type="text" value="<?php print($config['PUSHED_APP_KEY']);?>" /><br>
<label for="pushed_app_secret">Pushed App Secret: </label>
@@ -179,3 +180,4 @@ if(isset($_SESSION['success'])){
</div>
</body>
<input type="reset" form=">
+
diff --git a/scripts/email_template.html b/scripts/email_template.html
new file mode 100644
index 00000000..4dd2fcc1
--- /dev/null
+++ b/scripts/email_template.html
@@ -0,0 +1,10 @@
+Hi, Tim, and thank you so much for BirdWeather.com!
+%0A%0A
+Below is the information I would like to use to request a BirdWeather ID
+%0A%0A
+Latitude={{ LATITUDE }}%0A
+Longitude={{ LONGITUDE }}%0A
+Location= [ Create a location name ]%0A
+%0A%0A
+Thank you so much!%0A
+[ Your Name Here ]