Overview
Mail Telegram plugin allows to receive site mail to your telegram account via bot. You can log all email sent on the website or configure this plugin to receive only notification emails for particular administrator(s). Use case: you want to receive your contact form emails to the Telegram.
See the documentation for configuration details.
Installation
Artisan
Using the Laravel’s CLI is the fastest way to get started. Just run the following commands in a project’s root directory:
php artisan plugin:install vdomah.mailtelegram
License
© 2019, Art Gek under GNU GPL v3.
Developed by Art Gek.
Inspired by Exception Report to Telegram by Alexander Shapoval
Full documentation about telegram bots, you can see here: https://core.telegram.org/bots/api
Get bot token
Create bot by @BotFather. Bot token will look like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
Get user chat id
For getting user chat id - write any message to bot or just click Start. Then you can go to Mail Telegram settings and in Receivers tab you'll see your telegram user ID. Second way you can get your user's ID - open the following url in your browser:
https://api.telegram.org/bot{{token}}/getUpdates
Don't forget to replace {{token}} with your bot token.
Enter this token and chat id into plugin settings. That is all, have a nice experience with this plugin!
Other settings
Disabled in debug
You can disable telegram notifications in debug mode.
Disabled sending mail to Telegram
You can disable telegram notifications at all.
Admins to send mail
If you check admin1 - only those mail that has "To" parameter set to admin1's e-mail will be sent to the Telegram chat.
Formatting tab
Strip ends of lines
Make notification mail text compact by stripping ends of lines. That will transform the mail text into one paragraph.
-
Nick Vilaribov
Found the plugin useful on 14 May, 2020
A flexible solution for alerts from the site. Notifications can be received by several people at once. The plugin is very easy to configure. Recommend.
-
Oleg
Found the plugin useful on 13 Apr, 2020
Great plugin! Easy to configure.
-
Sergey
Found the plugin useful on 10 Dec, 2019
Quick and easy to configure, works great
-
1.0.12 |
Instructions to use @getidsbot for obtaining telegram user id. Jan 25, 2021 |
---|---|
1.0.11 |
Permission to restrict access to Mail Telegram settings. Jan 25, 2021 |
1.0.10 |
Ability to prevent email sending to mailboxes (to send it only to Telegram chat). Dec 24, 2020 |
1.0.9 |
Ability to define telegram_token while instanciating Telegram object (overrides token from settings). Dec 12, 2020 |
1.0.8 |
Fix not sending if app.debug==false. Formwidget Updates log. Refactor code from Plugin.php to Helper. May 14, 2020 |
1.0.7 |
Fix error when telegram_chat_ids is empty. May 03, 2020 |
1.0.6 |
Fix typo in Updates log in settings. Mar 20, 2020 |
1.0.5 |
Check if message's chat object exists and got properties required to display Updates log in settings. Mar 20, 2020 |
1.0.4 |
Fixed telegram_chat_id field bug after the field was removed. Jan 05, 2020 |
1.0.3 |
!!! telegram_chat_id field removed, use telegram_chat_ids instead. Untypical response handled in get_updates_log using var_dump. Jan 05, 2020 |
1.0.2 |
Removed test bot token from get_updates_log Dec 20, 2019 |
1.0.1 |
!!! Multiple receivers in Telegram now possible ("telegram chat id" field - deprecated); getUpdates log in settings; optional compressing text into one paragraph. Dec 20, 2019 |
1.0.0 |
First version of MailTelgram Dec 10, 2019 |
1.0.1
Telegram chat id field is deprecated. Use "Telegram chat ids" in Receivers tab instead. Telegram chat id field will be removed in next versions.