Skip to content

Notifly from CMS

CMS, in which dozens or hundreds of sites run, usually send mail themselves, but that’s slow and often doesn’t arrive. Notifly provides an instant channel for the site admin: new comment — push, new order — push, PHP error — push.

  1. A site on Tilda → Notifly in Tilda, option 2: the form webhook goes straight into the Notifly Webhook Router. No code and no hosting of your own.
  2. You only need form leads and cannot reach the PHP → WebScript of the “Form submit” type: paste the ready-made <script> into the page template or an HTML block, and every submitted form arrives as a push. The snippet forwards all form fields, so do not put it on forms with passwords or payment details.
  3. WordPress, 1C-Bitrix and other CMS → the recipe for your CMS in the table below. The code is ready, but you have to put it on the site’s server and fill in the token: you need access to the files (FTP, SSH or a hosting panel) and a basic understanding of PHP.
  4. Is the site up at all? → Active monitors: Notifly itself checks the site and tells you if it goes down. No code, everything in the admin panel.
CMS / platformWhat we cover
WordPressComments, registrations, updates, WooCommerce orders
1C-BitrixOrders, forms, errors, agent jobs
DrupalNode hooks, watchdog, new users
MODXForm events, resources, plugins
JoomlaUsers, articles, forms, PHP errors
OpenCartOrders, low stock, registrations
PrestaShopOrders, new customers, out of stock
TildaForm leads via webhook

Most recipes use the same micro-function. Put it into the CMS system autoload script:

<?php
function notifly_send(string $title, string $message, int $priority = 5): void {
$url = getenv('NOTIFLY_URL') ?: 'https://api.notifly.ru';
$token = getenv('NOTIFLY_TOKEN') ?: 'AGdjfk_L.dKe8q';
$body = json_encode([
'title' => mb_substr($title, 0, 200),
'message' => mb_substr($message, 0, 1500),
'priority' => $priority,
], JSON_UNESCAPED_UNICODE);
$ch = curl_init("$url/message?token=$token");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_TIMEOUT => 5,
CURLOPT_CONNECTTIMEOUT => 3,
]);
curl_exec($ch);
curl_close($ch);
}

It’s best to set NOTIFLY_URL and NOTIFLY_TOKEN via the PHP-FPM environment or .htaccess/SetEnv, so you don’t store the token in the code.

  • The channel token stays on the server. Call /message from server-side PHP only. The only thing you may put on a page is a WebScript snippet: its token can only send this script’s events.
  • Do not send PII (names, email, addresses) unnecessarily. Show a short link to the CMS admin.
  • Throttling. During a spam wave of comments, don’t turn Notifly into a Telegram channel. A simple cache in wp_cache/bx_cache will do.