Created
August 9, 2022 14:59
-
-
Save rslhdyt/f57981b393ec4540609877043aebe78b to your computer and use it in GitHub Desktop.
Cloud function for forwarding request to whatsapp API
This file contains hidden or 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
use Psr\Http\Message\ServerRequestInterface; | |
function product(ServerRequestInterface $request) | |
{ | |
$name = "Banana"; | |
$phoneNumber = "62812334444" | |
$queryString = $request->getQueryParams(); | |
$name = $queryString['name'] ?? $name; | |
header("Location: https://api.whatsapp.com/send?phone=" . $phoneNumber . "&text=" . $name); | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment