Giter VIP home page Giter VIP logo

webhooktoemail's Introduction

1 简介

将Bookstack知识库软件的webhook消息转发给指定邮箱

2 选项

[root@testkb dist]# ./webhookToEmail  -h
usage: webhookToEmail [-h] [-listen LISTEN] [-smtpserver SMTPSERVER] [-smtpport SMTPPORT] [-sender SENDER] [-password PASSWORD] [-file FILE]

A script for sending emails based on webhook data

options:
  -h, --help            show this help message and exit
  -listen LISTEN        webhook listener port
  -smtpserver SMTPSERVER
                        The SMTP server address,example:smtp.exmail.qq.com
  -smtpport SMTPPORT    The SMTP server port
  -sender SENDER        The sender email address,example:[email protected]
  -password PASSWORD    The sender email password
  -file FILE            The reciver email file

3 使用例子

3.1 准备邮件接收列表

[root@testkb dist]# cat .\recMail.ini
[email protected]
[email protected]
[email protected]

3.2 启动程序

[root@testkb dist]# ./webhookToEmail -listen 8000 -smtpserver smtp.exmail.qq.com -smtpport 465 -sender [email protected] -password xxxx -file ./recMail.ini 
 * Serving Flask app 'webhookToEmail'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8000
 * Running on http://192.168.1.121:8000
Press CTRL+C to quit
Data received from Webhook is:  {'event': 'commented_on', 'text': '管理员 评论 "堡垒机创建登录用户"', 'triggered_at': '2023-07-04T03:51:17.000000Z', 'triggered_by': {'id': 1, 'name': '管理员', 'slug': '41f1f'}, 'triggered_by_profile_url': 'http://192.168.1.121/user/41f1f', 'webhook_id': 1, 'webhook_name': 'testpython', 'url': 'http://192.168.1.121/books/c9f0f/page/6da90', 'related_item': {'id': 6, 'book_id': 1, 'chapter_id': 0, 'name': '堡垒机创建登录用户', 'slug': '6da90', 'priority': 7, 'created_at': '2023-05-05T01:12:41.000000Z', 'updated_at': '2023-07-03T05:37:20.000000Z', 'created_by': {'id': 1, 'name': '管理员', 'slug': '41f1f'}, 'updated_by': {'id': 1, 'name': '管理员', 'slug': '41f1f'}, 'draft': False, 'revision_count': 2, 'template': False, 'owned_by': {'id': 1, 'name': '管理员', 'slug': '41f1f'}, 'editor': 'wysiwyg'}}
192.168.1.121 - - [04/Jul/2023 11:51:17] "POST /webhook HTTP/1.1" 200 -
send email OK!

3.3 发起评论,触发webhook

image

3.4 接收webhook

image

3.5 接收邮件通知

image

webhooktoemail's People

Contributors

kernelry 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.