NotifyHub
Integrations

WordPress Plugin

Integra NotifyHub in qualsiasi sito WordPress in 5 minuti. Hook automatici per commenti, WooCommerce e Contact Form 7.

Download & Installazione

Requisiti

WordPress5.8 o superiore
PHP7.4 o superiore
WooCommerceOpzionale, per hook ordini
Contact Form 7Opzionale, per hook form

Installazione

  1. Scarica il file ZIP dal pulsante qui sopra
  2. Nel pannello WordPress vai su Plugin → Aggiungi nuovo → Carica plugin
  3. Seleziona il file notifyhub-wp.zip e clicca Installa ora
  4. Attiva il plugin "NotifyHub WP"
  5. Vai su Impostazioni → NotifyHub per configurarlo

Configurazione

Dopo l'attivazione, vai su Impostazioni → NotifyHub. Sono necessari 3 campi per connettere il plugin al tuo workspace.

Connessione API

URL NotifyHubhttps://notify.trovido.com — URL del portale NotifyHub
API KeyChiave Bearer generata dalla sezione /sources del portale
Telefono notificheNumero WhatsApp/Telegram per ricevere le notifiche (formato +39...)

Impostazioni predefinite

Canale predefinitowhatsapp | telegram | email — canale di invio per gli hook automatici
Template predefinitoSlug del template usato dagli hook (es. nh_wp_notification)

Hook automatici

Abilita o disabilita individualmente gli hook per commenti, ordini WooCommerce e form Contact Form 7 tramite le relative checkbox.

Pagina impostazioni WordPress
Impostazioni → NotifyHub
---------------------------------

Connessione API
  URL NotifyHub:     [https://notify.trovido.com]
  API Key:           [nh_live_xxxxxxxxxxxxx      ]
  Telefono:          [+393331234567               ]

Impostazioni predefinite
  Canale:            [WhatsApp  v]
  Template:          [nh_wp_notification          ]

Hook automatici
  [x] Nuovo commento
  [x] Ordine WooCommerce
  [ ] Form Contact Form 7

           [Salva impostazioni]

---------------------------------
Test invio
  Numero test:       [+393331234567               ]
           [Invia test WhatsApp]

Hook automatici

Il plugin intercetta eventi WordPress e invia notifiche automatiche via NotifyHub. Ogni hook puo essere abilitato singolarmente dalla pagina impostazioni.

Nuovo commento

Invia una notifica quando un visitatore pubblica un commento su un post o una pagina.

Hook WPcomment_post
TemplateConfigurabile (default: nh_wp_notification)
Idempotencywp_comment_{comment_id}
{{1}} author_name {{2}} post_title {{3}} comment_excerpt

Ordine WooCommerce

Invia una notifica per ogni nuovo ordine ricevuto. Richiede WooCommerce attivo.

Hook WPwoocommerce_new_order
Templatenh_woo_order
Idempotencywp_woo_{order_id}
{{1}} order_id {{2}} customer_name {{3}} total

Form Contact Form 7

Invia una notifica quando un visitatore compila e invia un form CF7. I campi vengono riassunti automaticamente (max 10).

Hook WPwpcf7_mail_sent
Templatenh_wp_notification
Idempotencywp_cf7_{timestamp}
{{1}} form_title {{2}} fields_summary

Shortcode recensioni

Inserisci il form di raccolta recensioni in qualsiasi pagina WordPress con lo shortcode [notifyhub_review].

Flusso

  1. L'utente compila nome, email, valutazione (1-5 stelle), testo e foto opzionale
  2. Il plugin invia la recensione a NotifyHub via API
  3. L'admin riceve un messaggio WhatsApp/Email con bottoni Pubblica / Rifiuta
  4. Il click sul bottone esegue il callback al sito, aggiornando lo stato della recensione

Parametri

templateTemplate WhatsApp da usare (default: review_approval)
phoneNumero che riceve la richiesta di approvazione (default: telefono notifiche)
titleTitolo del form (default: Lascia una recensione)
successMessaggio di conferma dopo l'invio

Variabili template

{{1}} reviewer_name {{2}} star_rating {{3}} review_excerpt
Shortcode base
[notifyhub_review]
Shortcode con parametri
[notifyhub_review
    template="review_approval"
    phone="+393331234567"
    title="Lascia una recensione"
    success="Grazie! La tua recensione è stata inviata."]
Payload inviato a NotifyHub
{
  "recipient": {
    "whatsapp_phone": "+393331234567",
    "name": "MioSito Admin"
  },
  "channel": "whatsapp",
  "template": "review_approval",
  "vars": {
    "1": "Mario Rossi",
    "2": "5 stelle",
    "3": "Servizio eccellente, consiglio..."
  },
  "media": {
    "url": "https://sito.it/wp-content/uploads/photo.jpg",
    "type": "image"
  },
  "idempotency_key": "wp_review_a1b2c3d4..."
}

API diretta da PHP

Per integrazioni custom, usa la classe NotifyHub_API direttamente nel tuo tema o plugin WordPress.

Metodi disponibili

NotifyHub_API::send(array)Invio generico — accetta lo stesso payload dell'API REST
NotifyHub_API::send_whatsapp()Shortcut per WhatsApp: ($phone, $template, $vars, $actions)
NotifyHub_API::send_telegram()Shortcut per Telegram: ($chat_id, $template, $vars)
NotifyHub_API::send_email()Shortcut per Email: ($email, $template, $vars)
NotifyHub_API::is_configured()Ritorna true se API key e URL sono impostati

Risposta

Tutti i metodi ritornano un array con ok (bool), code (HTTP status) e data (body della risposta).

Invio WhatsApp con shortcut
NotifyHub_API::send_whatsapp(
    '+393331234567',
    'hello_world',
    ['name' => 'Mario']
);
Invio generico con media
NotifyHub_API::send([
    'recipient' => [
        'email' => '[email protected]'
    ],
    'channel'  => 'email',
    'template' => 'report',
    'vars'     => [
        'title' => 'Report settimanale',
        'date'  => date('d/m/Y'),
    ],
    'media' => [
        'url'  => wp_get_attachment_url($id),
        'type' => 'image',
    ],
]);
Controllo risposta
$result = NotifyHub_API::send([...]);

if ($result['ok']) {
    $delivery_id = $result['data']['delivery_id'];
} else {
    $error = $result['data']['message']
        ?? $result['error']
        ?? 'Errore sconosciuto';
    error_log('NotifyHub: ' . $error);
}

WP-CLI

Configura il plugin dalla riga di comando senza accedere al pannello WordPress. Utile per deploy automatizzati e provisioning server.

Configurazione base
# Imposta URL e API key
wp option update notifyhub_api_url \
    "https://notify.trovido.com"
wp option update notifyhub_api_key \
    "nh_live_xxxxxxxxxxxxx"
wp option update notifyhub_notify_phone \
    "+393331234567"

# Canale e template predefiniti
wp option update notifyhub_default_channel \
    "whatsapp"
wp option update notifyhub_default_template \
    "nh_wp_notification"
Attiva hook
# Commenti
wp option update notifyhub_on_comment 1

# Ordini WooCommerce
wp option update notifyhub_on_woo_order 1

# Contact Form 7
wp option update notifyhub_on_cf7 1
Verifica configurazione
wp option get notifyhub_api_url
wp option get notifyhub_api_key
wp option get notifyhub_on_comment

Vuoi integrare NotifyHub via REST API senza WordPress?

STAG
https://notify.trovido.com