Notification for Telegram

Description

Send Telegram messages notification:
* When receive new forms (supports CF7 and Ninjaform).
* When new user registers.
* When users login fail.
* When receive order payment in Woocommerce.
* When someone adds a product in the Woocommerce cart.
* When a new Pending posts is received. (works with any post type)
* Send custom message with Shortcode anywhere in your WP.

You can enable/disable every notification in the Plugin settings page.

To configure the plugin, you need a valid Telegram API token. Its easy to get starting a Telegram Bot.
You can learn about obtaining tokens and generating new ones in
this document
or follow the info in this post

You also need at least one “chatid” number, that is the recipient to the message will be send. To know you personal chatid number, search on telegram app for “@get_id_bot” or
click here

Once You got the 2 fields save the configuration and try the “TEST” button .. you should receive a message in you telegram : “WOW IT WORKS” !! If not, check token and chatid fields again for the correct values.

this plugin is relying on a 3rd party service to geolocate the Ip address https://ip-api.com/
https://ip-api.com/docs/legal to see the services’ a terms of use and/or privacy policies

Sorry this is the first release… I hope noy so buggy 🙂 If you like the plug rate It !

SHORTCODE EXAMPLE

[telegram_mess  message="Im so happy" chatids="0000000," token="000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" showsitename="1" showip="1" showcity="1" ]

SHORTCODE OPTIONS:

  • message : Your message to be sent. Example (message=”hello world”)

  • chatids : Recipient(s) who will receive your message separated by comma (example chatids=”0000000,11111111″) If empty , the shortcode will use default value in Plugin option page.

  • token: The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
    if empty , the shortcode will use default value in Plugin option page.

  • showsitename: if set to “1” appends sitename after the message. Defaultvalue is “0” Example (showsitename=”1″)

  • showip: if set to “1” appends user ip address after the message. Default value is “0” Example (showip=”1″)

  • showcity: if set to “1” appends user city name after the message. Default value is “0” Example (showcity=”1″)

USE SHORTCODE IN YOU PHP CODE

<?php

$date = date("d-m-Y");

do_shortcode('[telegram_mess  message="'.$date .'" chatids="0000000," token="000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" showsitename="1" showip="1" showcity="1" ]'); 

?>

Suggestions for other Notification, hooks and others plug integrations are Welcome !!

Screenshots

  • This is the Option page in you Dashboard. Enter Token Chatid
  • Choose which notification you want to receive
  • A shortcode example.
  • Post & Shortcode result on your Mobile app
  • Login fails result on your Mobile app

Installation

This section describes how to install the plugin and get it working.

e.g.

  1. Upload the plugin files to the /wp-content/plugins/plugin-name directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Use the Settings->Plugin Name screen to configure the plugin
  4. (Make your instructions match the desired user flow for activating and installing your plugin. Include any steps that might be needed for explanatory purposes)

FAQ

How to obtain Token?

When You create a telegram bot you will get a Token.
BotFather @botfather is the one bot to rule them all. It will help you create new bots and change settings for existing ones.

search for @botfather

Creating a new bot
Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authorization token for your new bot.

The name of your bot is displayed in contact details and elsewhere.

The Username is a short name, to be used in mentions and t.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot’s username must end in ‘bot’, e.g. ‘tetris_bot’ or ‘TetrisBot’.

The token is a string along the lines of 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw that is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot.

Generating an authorization token.
If your existing token is compromised or you lost it for some reason, use the /token command to generate a new one.

How to obtain the chat_id of a private Telegram channel?

The easiest way is to invite @get_id_bot in your chat and then type:

/my_id @get_id_bot

Can i insert more than one recipient chatid?

Yes you can add more than one chattid separated by a comma (,)
both in option page and in the shortcode.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Notification for Telegram” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1

add icons

1.0

Initial release