Skip to content

A custom Tawk.to webhook listener for WordPress. Validates requests with HMAC, sends email alerts for new chats, and works within a child theme.

Notifications You must be signed in to change notification settings

lazyZ33/tawkto-webhook-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Tawk.to Webhook Listener for WordPress

This repository contains a custom implementation of a webhook listener for the Tawk.to live chat application. The solution was developed for a WordPress site built with Elementor and uses a child theme to extend customization.

πŸ› οΈ Features

  • Webhook Validation: Ensures the requests are legitimate using HMAC signature verification.
  • Email Notifications: Sends an email whenever a new chat starts, containing:
    • Chat ID
    • Visitor Name
    • Email (if available)
    • City and Country
    • Property Name
  • Cost-Effective: Does not rely on paid tools like Zapier, IFTTT, or premium chat solutions.

πŸ“‚ File Structure

  • webhook-listener.php: Contains the code for the webhook listener. This file is added to the child theme folder for integration into the WordPress environment.

πŸš€ How It Works

  1. Place the webhook-listener.php file in your child theme directory.
  2. Update the secret key to match the one configured in your Tawk.to dashboard.
  3. Configure Tawk.to to send webhook events to the URL of this file.
  4. Whenever a user initiates a chat, the webhook sends data, and this script processes it, validating the request and sending email notifications.

πŸ“ Prerequisites

  • A WordPress website built with Elementor.
  • A child theme for customizations.
  • A working email server to send notifications.

πŸ“§ Customization

  • Replace the contact@yourdomain.com email address in the script with the desired recipient.
  • Add additional fields to the email content if needed.

🌟 Why This Solution?

This project was developed as a cost-effective alternative for a client who wanted to avoid paid services. The webhook listener was designed to:

  • Integrate seamlessly with the existing WordPress website.
  • Use only free tools and services.

πŸ–₯️ Demo

When a visitor starts a chat on Tawk.to, an email is sent with following details:

  • Chat ID: ''
  • Visitor: ''
  • Email: ''
  • City: ''
  • Country: ''
  • Property: ''

πŸ”’ Security

This script uses HMAC verification to ensure only legitimate requests from Tawk.to are processed.

About

A custom Tawk.to webhook listener for WordPress. Validates requests with HMAC, sends email alerts for new chats, and works within a child theme.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages