Skip to content

mazezen/push-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

push-notify

PHP CSS3 DingTalk Feishu Gmail

Push notify

Simple message push notification system. Support Telegram group robotsDingTalk group robotsFeiShu group(user) robotsGmail

  • Telegram group robot: login Telegram @BotFather Create a bot to obtain a token. Verify the validity of the token by obtaining bot information through getme Get chat_id through getUpdates. It is usually a negative number, for example: -1212112212
  • DingTalk group robot : Log in to dingTalk client. Select the group chat you want to push Click on Settings in the upper right corner, create a robot, and select Custom Robot Fill in the robot name and copy the webhook. Be careful not to leak the webhook information, which includes the access_token. There are three options for security settings: custom keywords, signature, IP address (segment), and set as needed Documentation customize-robot-security-settings.
  • FeiShu group(user) robot: Login in to fei shu open platform. Follow this tutorial to create applications, robots, and robot capabilities Using the Start Debugging Console to Write Code
  • Gmail: 16 is a Google email specific password Google account needs to enable two factor authentication first

Environment

  • php: >=8.0.30
  • composer

Packages list

  • guzzlehttp/guzzle
  • monolog/monolog
  • phpmailer/phpmailer

Install

composer install

Supported platform

Overseas platforms
Telegram https://telegram.org/
Gmail https://mail.google.com/
Domestic platforms
dingTalk https://open.dingtalk.com/
FeiShu https://feishu.cn/

Usage

  1. Telegram group robot notify
php telegram.php 
  1. DingTalk group robot notify
php dingTalk.php 
  1. Feishu group(user) robot notify
php feiShu.php 
  1. Gmail notify
php email.php

Constant Introduction

/*-----------------------------------------------------------------*/
public const TimeOut = 10;  // http request timeout
public const Proxy = "";    // http request proxy
/*-----------------------------------------------------------------*/



/*-----------------------------------------------------------------*/
/**
 * const telegram
 *
 * Document: https://core.telegram.org/bots/tutorial
 */
public const tgBaseUrl = 'https://api.telegram.org/';

/**
 * const tgBotToken
 *
 * telegram bot token
 */
public const tgBotToken = '';

/**
 * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
 */
public const tgChatId = '';

/**
 * https://core.telegram.org/bots/api#sendmessage
 */
public const sendMessage = "/sendMessage";
/**
 * https://core.telegram.org/bots/api#getme
 */
public const getMe = "/getme";

/**
 * https://core.telegram.org/bots/api#getupdates
 */
public const getUpdates = "/getUpdates";
/*-----------------------------------------------------------------*/


/*-----------------------------------------------------------------*/
/**
 * dingTalk bot webhook
 */
public const DingTalkWebhook = "https://oapi.dingtalk.com/robot/send";
/**
 * dingTalk access token
 */
public const DingTalkAccessToken = "";
/**
 * dingTalk bot secret
 */
public const DingTalkSecret = "";
/*-----------------------------------------------------------------*/

/*-----------------------------------------------------------------*/
/**
 * https://open.feishu.cn/document/server-docs/im-v1/message/create
 */
public const FeiShuUrl = "https://open.feishu.cn/open-apis/im/v1/messages";

/**
 * fei shu access token
 */
public const FeiShuToken = "";

/**
 * fei shu open id (user id)
 */
public const FeiShuOpenId = "";

/**
 * fei shu chat id (group id)
 */
public const FeiShuChatId = "";
/*-----------------------------------------------------------------*/

/*-----------------------------------------------------------------*/
public const MailHost = 'smtp.gmail.com';

public const MailPort = 587;

public const MailUser = '';

/**
 * 16 is a Google email specific password Google account needs to enable two factor authentication first
 */
public const MailPassword = '';

public const MailFrom = '';

public const MailFromName = '';

public const MailTo = "";

public const MailToName = '';

/*-----------------------------------------------------------------*/

About

Simple message push notification system. Support Telegram group robots 、DingTalk group robots、Feishu group (user)robots、Gmail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages