Last active
June 19, 2022 21:12
-
-
Save GlitchWitch/6863f471dcecad88d1c0cb9b592103c0 to your computer and use it in GitHub Desktop.
Twilio SMS Forward + Auto-response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This section ensures that Twilio gets a response. | |
*/ | |
header('Content-type: text/xml'); | |
echo '<?xml version="1.0" encoding="UTF-8"?>'; | |
echo '<Response><Message>Your message could not be delivered. This number only accepts encrypted messages through Signal Private Messenger. Download it here https://signal.org/install</Message></Response>'; //Place the desired response (if any) here | |
/** | |
* This section actually sends the email. | |
*/ | |
/* Your email address */ | |
$to = "[email protected]"; | |
$subject = "Message from {$_REQUEST['From']} at {$_REQUEST['To']}"; | |
$message = "You have received a message from {$_REQUEST['From']}. Body: {$_REQUEST['Body']}"; | |
$headers = "From: [email protected]"; // Who should it come from? | |
mail($to, $subject, $message, $headers); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment