Skip to content

Instantly share code, notes, and snippets.

@rslhdyt
Created August 9, 2022 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rslhdyt/f57981b393ec4540609877043aebe78b to your computer and use it in GitHub Desktop.
Save rslhdyt/f57981b393ec4540609877043aebe78b to your computer and use it in GitHub Desktop.
Cloud function for forwarding request to whatsapp API
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