Home/Answers/Send a notification from PHP
Answer

How do I send a notification to my phone from PHP?

POST to your Lert link with cURL. One call with a title and body and your phone buzzes โ€” even locked in your pocket. No account, no API keys, no SDK. PHP's cURL extension is all you need.

Whether it's a WordPress plugin, a Laravel controller, or a plain PHP form handler, the moments worth knowing about โ€” an order, a contact form, a failed cron โ€” all happen server-side while you're doing something else. Lert puts them on your lock screen. PHP already bundles the cURL extension, so there's nothing to composer require; because your Lert link is the credential, there's no key to manage either.

Set it up in under 30 seconds

  1. Download the app. Open it once โ€” there's no account to create. Your private link is on screen.
  2. Copy your link. One tap copies https://lert.dev/p/your-id.
  3. POST to it from PHP. Drop the cURL snippet wherever you want the buzz.

Load the page or run the job and your phone buzzes.

Example: with PHP cURL

php
$ch = curl_init("https://lert.dev/p/your-id");
curl_setopt_array($ch, [
    CURLOPT_POST       => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode([
        "title" => "New order ๐ŸŽ‰",
        "body"  => "Order #1042 โ€” $58.00",
        "tag"   => "orders",
    ]),
]);
curl_exec($ch);
curl_close($ch);

No auth header, no SDK โ€” just cURL. Add it to a WooCommerce hook, a Laravel event listener, or a bare if in a script. Set a short CURLOPT_TIMEOUT so a slow network never holds up the page render.

Tip: in WordPress you can skip raw cURL and use wp_remote_post() with the same JSON body โ€” it respects your site's HTTP settings and proxies. Either way it's one call to your Lert link.

Related setups

See the full PHP guide and the form submission notifications use case. It's free for one channel and 50 notifications a day; Lert Pro is $2.99/month for unlimited. Full details in the docs.

One cURL, straight to your phone.

Download Lert, copy your link, add one cURL call. Your phone buzzes when it matters.

Get the app iOS