Giter Club home page Giter Club logo

erpnext_telegram's Introduction

Erpnext Telegram Integration And Notifications

Telegram Integration and Extra Notifications For Frappe & Erpnext to sending fast notifications for more productivity.

Main features

Telegram Notifications:

  • Sending custom notification by Telegram Bots to Users, Employees, Customers, Suppliers or Students, and Telegram group chat.
  • Sending Telegram direct messages from any form view.
  • Multiple Telegram Bots channels.

SMS Notifications:

  • Sending custom notification by SMS to Users, Employees, Customers, Suppliers or Students .

Date Notifications:

  • Get alerts on important dates

How to Install

  1. ./env/bin/pip install python-telegram-bot --upgrade "This command is necessary to install the python-telegram-bot into bench environment. Otherwise, the pip3/pip command will install it in the python environment"

  2. bench get-app erpnext_telegram_integration https://github.com/yrestom/erpnext_telegram.git

  3. bench --site [your.site.name] install-app erpnext_telegram_integration

  4. bench build

  5. bench restart

  6. Create a new Telegram bot in BotFather

    For more reference :

  7. Get Telegram Bot Token from BotFather

Setup and Use:

Telegram Notifications:

In Erpnext Telegram Integration

  1. Go to → Telegram Settings -> New Enter Telegram Bot Token

  2. Go to → Telegram User Settings -> New to setup and define a new user setting

    1. Choose party.
    2. Choose Telegram User.
    3. Choose Telegram Settings.
    4. If it's a group check "Is Group Chat".
    5. Press "Generate Telegram Token" then the app will copy the "Telegram Token" to clipboard and will open a new window into the browser to the Bot web page.
    6. Paste "Telegram Token" in the Telegram Bot or if it is a Group Chat paste in the group after adding the Bot.
    7. Press "Get Chat ID" And if everything is ok it will get the chat ID.
    8. Press Save.
  3. Go to → Telegram Notification -> New You can configure various notifications in your system to remind you of important activities. As the original Erpnext Notification.

    Here chose the profile of "Telegram User Settings" want to send to him the notification or use the checkbox "Dynamic Recipients" to get the recipient from the DocType dynamically if it has a Link Field like "Customer", "Supplier", "Student" or "Employee", for this it needs to set up a "Telegram User Settings" for the customer, supplier ...

  4. Also, you can send directly a Telegram message from any form view by going to the Menu and click "Send To Telegram".

  5. When the app send a Telegram Notification it will write a new log into Extra Notifications > Extra Notification Log .

SMS Notifications:

in Extra Notifications:

  1. Go to → SMS Settings and set it up as here.

  2. Go to → SMS Notification → New

    You can configure various notifications in your system to remind you of important activities. As the original Erpnext Notification.

    Here chose the "Recipients" want to send to them the notification or use the checkbox "Dynamic Recipients" to get the recipient from the DocType dynamically if it has a Link Field like "Customer", "Supplier", "Student" or "Employee", for this it needs to set up a Contact for the customer, supplier..., and make sure the contact is related to the customer or supplier... and has Primary Mobile number as default.

  3. Press Save.

Date Notifications:

in Extra Notifications:

  1. Go to → Date Notification → New.
  2. Choose the DocType Name.
  3. Press "Get Date Fields"
  4. Choose the wanted fields an delete the rest.
  5. Configure when the alert will be trigger by selecting "Days Before" or "Days After" and selecting a number of days for each field.
  6. Configure the "Conditions" if need it.
  7. Press Save.

When the Date Notification is trigger it will send an email to the related user and it will write a new log into Extra Notifications > Extra Notification Log .

Dependencies

  1. Frappe Version 12+
  2. Python Version 3+
  3. python-telegram-bot

License

MIT

erpnext_telegram's People

Contributors

aakvatech avatar ahmadragheb avatar mohsinalimat avatar penieldev avatar rjpvt avatar tropicalrambler avatar vrslev avatar yrestom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erpnext_telegram's Issues

Can't get Chat ID

Frappe v14.21.1
ERPNext v14.12.0
Erpnext Telegram Integration v1.1.0 (master)

Ubuntu 22.04.1 LTS x86_64
python telegram bot 20

I have followed your small tutorial on Discuss, and as soon I press Get Chat ID I get

Failed to load resource: 500 error: https://mysite/api/method/erpnext_telegram_integration.erpnext_telegram_integration.doctype.telegram_user_settings.telegram_user_settings.get_chat_id_button

I've installed python telegram bot in my bench env, as well outside my bench env.

Telegram Notification Issue After Updating to Version 14

I have been experiencing with Telegram notifications after updating to version 14. It has been causing inconvenience in my day-to-day communication, and I am seeking your assistance in resolving this matter

Error
Traceback (most recent call last):
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 412, in evaluate_alert
alert.send(doc)
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 148, in send
self.send_a_telegram_msg(doc, context)
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 209, in send_a_telegram_msg
send_to_telegram(
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_settings/telegram_settings.py", line 45, in send_to_telegram
asyncio.run(bot.send_message(chat_id=telegram_chat_id, text=message))
File "/usr/lib/python3.10/asyncio/runners.py", line 37, in run
raise ValueError("a coroutine was expected, got {!r}".format(main))
ValueError: a coroutine was expected, got <telegram.message.Message object at 0x7fd8fcf2bdc0>

image

Telegram Error on ERPNext - Cannot process any document

Hi,

Suddenly whenever I try to save any document which should trigger the telegram notification on ERPNext. The document cannot save and I receive the following error.

Traceback (most recent call last):
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 412, in evaluate_alert
    alert.send(doc)
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 148, in send
    self.send_a_telegram_msg(doc, context)
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 209, in send_a_telegram_msg
    send_to_telegram(
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_settings/telegram_settings.py", line 45, in send_to_telegram
    asyncio.run(bot.send_message(chat_id=telegram_chat_id, text=message))
  File "/usr/lib/python3.10/asyncio/runners.py", line 37, in run
    raise ValueError("a coroutine was expected, got {!r}".format(main))
ValueError: a coroutine was expected, got <telegram.message.Message object at 0x7ff2e91a6620>

I am using ERPNext 14, hosted on Frappe Cloud
Our whole system is dependent on your amazing notification system. Please help me with this. Thanks :)

Notifications are not working since few days

Suddenly the notifications have stopped working, I am using frappe cloud hosted ERPNext and have installed Telegram Notifications, everything was working smoothly and suddenly this happened.
When I try to add a new user in telegram user settings, I cannot save the record even, i think the chat id is not updating as well.

Notification sends /app/doc... link by default in every telegram message

Even if the message is customized to be something else, the message by default contains 'See the document at ....' at the bottom of each message. I need to either disable this, or customize it - since the TG group is public and the documents being updated are public website documents, not something a user logs into desk to see.

Please advise on how to edit the code to fix this

When installing on a local VM

Hi,

Installing erpnext_telegram_integration...
An error occurred while installing erpnext_telegram_integration:
invalid syntax (base.py, line 42)

ERPNext version
erpnext 12.18.0
erpnext_documentation 0.0.1
erpnext_telegram_integration 0.0.5
frappe 12.15.0

Telegram Notification(Login And Logout)

I am trying to make a Telegram notification when the user is log out or log in
I fill this data in fields:
1-Send alert on:('new' or 'save')
2-DocumentType('Activity Log')

When I enable this alert and save when the user press log out Error message showing
Error message('can only concatenate str (not "int") to str')
I will attach picture for error message and picture for Notification Screen

Note(I used the notification when the user submit the sale invoice and it is work good and the message sent to telegram )
please guide me .thanks
Telegram Notification2
Telegram Notification1
error message

Missing recipint table

hi guys i am unable to see the recipient table even after selecting dynamic recipient from the checkbox..i am help is nice
vrsion 13.16 and 13.16.01 erpnext n frappe..

image

image

no recipint table

Support for ERPNext Version-14

Hi,
I am trying to upgrade my Erpnext Version 13 to Version 14. I have this app installed on my Version 13 instance.
However, when I am trying to upgrade bench command is throwing error that it couldn't find the git reference of erpnext_telegram app for the version 14.
Did anyone try upgrading to Version 14 and anyone find a solution?

Thanks & Regards,
Vinod Kumar K

async with bot: AttributeError: __aenter__

request.js:457
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 94, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 47, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1619, in call
return fn(*args, **newargs)
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_user_settings/telegram_user_settings.py", line 52, in get_chat_id_button
chat_id = asyncio.run(get_chat_id(telegram_token_bot, telegram_token))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_user_settings/telegram_user_settings.py", line 60, in get_chat_id
async with bot:
AttributeError: aenter

Frappe Framework - v14.41.0
ERPNext - v14.31.3

Error while sending telegram notification

I am getting this error while my telegram notification is running i got the message in my telegram but system shows we this message and as i am sending this notification on submit it do not go forward to next step.
Error:
a coroutine was expected, got <telegram.message.Message object at 0x7f45b32835e0>
image
image
image
image

Open SMS Notification List Error

SMS Notification SMS Notification not found

Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/sms_notification/sms_notification.py", line 331, in evaluate_alert
alert = frappe.get_doc("SMS Notification", alert)
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 850, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 75, in get_doc
return controller(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 113, in init
self.load_from_db()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 156, in load_from_db
frappe.throw(("{0} {1} not found").format((self.doctype), self.name), frappe.DoesNotExistError)
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 432, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 411, in msgprint
_raise_exception()
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 365, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: SMS Notification SMS Notification not found

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.