Giter VIP home page Giter VIP logo

whatsapp-notification-blesta's Introduction

Introduction

Original: https://github.com/Intprism-Technology/Whatsapp-WHMCS

Changelog

Features

  • [OK] API Kirim Pesan ke Nomor
  • [OK] Auto Response / BOT
  • [OK] Blesta Billing Alert
    • Invoice Terbit
    • Invoice Paid
    • Invoice DueDate
    • Last Notification 1day Before Terminate

Requirements

  • NodeJS v18
  • Python v3
  • Pip Python

Install

  • Install NodeJS
    https://nodejs.org/en/download/
    
  • Install Python3 PIP & dependency (Ubuntu)
    apt install python3-pip
    
  • Clone repository and Install Library
    git clone https://github.com/reynaldiarya/WhatsApp-Notification-Blesta.git
    cd WhatsApp-Notification-Blesta
    npm install
    
  • Konfigurasi API
    nano blesta/config.py
    
    edit baris berikut
    url = ''
    user = ''
    key = ''
    
  • Konfigurasi template pesan notifikasi Blesta
    nano blesta/template_message.py
    
    template variabel
    # Nama Depan: {firstName}
    # Nama Belakang: {lastName}
    # Nomor HP: {phone}
    # Nomor Invoice: {invoiceNumber}
    # Due Date: {duedate}
    # Total Tagihan: {duetotal}
    
    invoice_unpaid = "Halo, *{firstName} {lastName}*"
    invoice_paid = "Halo, *{firstName} {lastName}*"
    invoice_duedate = "Halo, *{firstName} {lastName}*"
    invoice_comingTerminate = "Halo, *{firstName} {lastName}*"
    
  • Login Whatsapp sebagai contoh, instalasi di path /var/www/WhatsApp-Notification-Blesta
    node /var/www/WhatsApp-Notification-Blesta/index.js
    
    • scan qr hingga muncul success pairing
    • exit program / CTRL + C

Run Service

  • Whatsapp BOT & API
    • edit cron
    @reboot sleep 5 && node /var/www/WhatsApp-Notification-Blesta/index.js &
    
    • jalankan service ulang
    node /var/www/WhatsApp-Notification-Blesta/index.js &
    
  • Service Kirim Invoice Blesta Notifikasi (tiap hari, jam 8 pagi) dan notifikasi invoice paid & unpaid (tiap 5menit)
    */5 * * * * /usr/bin/python3 /var/www/WhatsApp-Notification-Blesta/blesta/invoice_paid.py
    */5 * * * * /usr/bin/python3 /var/www/WhatsApp-Notification-Blesta/blesta/invoice_unpaid.py
    0 8 * * * /usr/bin/python3 /var/www/WhatsApp-Notification-Blesta/blesta/invoice_duedate.py
    0 8 * * * /usr/bin/python3 /var/www/WhatsApp-Notification-Blesta/blesta/invoice_comingTerminate.py
    

Endpoint

  • API Endpoint

    <ip>:8080/api/send
    

    Type: POST

    Variable:

    phone (required)
    message (required)
    

whatsapp-notification-blesta's People

Contributors

reynaldiarya avatar

Stargazers

Afrizal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.