=== Rnotifier for Telegram ===
Contributors: rad18
Tags: telegram, contact form 7, wpforms, notifications, connector
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 1.0.4
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Get a Telegram notification whenever someone submits a Contact Form 7 or WPForms form on your site.

== Description ==

Rnotifier for Telegram sends a message to your Telegram bot every time a supported contact form is submitted — no need to keep checking your email inbox. This plugin is not affiliated with or endorsed by Telegram.

It's a connector, not a form builder: it works alongside the form plugin you already use.

Supported form plugins:

* **Contact Form 7**
* **WPForms**

Only the sections for form plugins that are actually active on your site appear in the settings — nothing to configure for plugins you don't use.

Features:

* One Telegram bot, one or more chat IDs (comma-separated) — notify yourself and a team chat at once
* Per form plugin: enable/disable, restrict to specific form IDs, and a custom message template
* Message placeholders: `{all_fields}`, `{field_KEY}` for a single field, `{form_title}`, `{page_url}`, `{submitted_at}`
* "Save & test connection" button to check your bot token and chat ID before going live
* A short error log (last 20 entries) if a message fails to send — without storing the submitted data itself
* No notification is sent for any form until you explicitly list its form ID — nothing goes out by default

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`
2. Activate the plugin from the Plugins screen
3. Create a bot with [@BotFather](https://t.me/BotFather) on Telegram and copy its token
4. Go to the Rnotifier menu item, paste the bot token and your chat ID(s)
5. Under the form plugin you use, enable notifications and enter the form ID(s) to notify on
6. Click "Save & test connection" to confirm it works

== Frequently Asked Questions ==

= How do I find my Telegram chat ID? =

Message your bot once, then open `https://api.telegram.org/bot<TOKEN>/getUpdates` in a browser and look for the `chat.id` value. For a group or channel, add the bot there first, post any message, then check `getUpdates` the same way. Personal chat IDs are positive numbers; group IDs are negative; supergroup/channel IDs are negative and start with `-100`.

= Can I send notifications to a group or channel instead of a personal chat? =

Yes — list any mix of user, group, and channel IDs in "Chat ID(s)", comma-separated. Each has its own requirement from Telegram itself (the plugin can't override these): a user must have messaged the bot at least once before the bot can message them back; for a group, the bot must be added as a member; for a channel, the bot must be an admin with permission to post.

= Why isn't a form's submission triggering a notification? =

Check that: the form plugin's section is enabled, the form's ID is listed in "Form IDs" for that plugin, and the bot token/chat ID are correct (use "Save & test connection" to confirm those independently).

= Does this store form submissions inside the plugin? =

No. The plugin only reads the submitted data long enough to build and send the Telegram message; it isn't saved anywhere by this plugin. If a message fails to send, only the error itself is logged — not the submitted data.

= Can I use HTML formatting in the message template? =

Yes, a limited set: `<b>`, `<i>`, `<a href="...">`, `<code>`. This matches what Telegram's HTML parse mode supports.

= Is this plugin affiliated with Telegram? =

No. "Telegram" refers to the messaging service this plugin sends notifications to via its public Bot API; this plugin is an independent, unofficial integration.

== Screenshots ==

1. Main settings screen — bot token, chat IDs, and per-form-plugin status.
2. Per-form settings — enable notifications, restrict to specific form IDs, and customize the message template.

== External services ==

This plugin connects to the Telegram Bot API to deliver form-submission notifications to the Telegram chat(s) you configure. This is a required, core part of how the plugin works — there is no way to send a Telegram message without contacting Telegram's own servers.

* **What it is and what it's used for:** the Telegram Bot API (api.telegram.org), operated by Telegram, used to send a chat message via your own bot whenever a supported form (Contact Form 7 or WPForms) is submitted on your site.
* **What data is sent, and when:** every time a form you've enabled notifications for is submitted, the submitted field values (whatever the form collects — for example name, email, phone, or message) are sent to Telegram's servers as the text of the bot message, together with the page URL and submission time. This only happens for forms you've explicitly enabled and listed a form ID for — nothing is sent by default.
* Terms of Service: https://telegram.org/tos/bots
* Privacy Policy: https://telegram.org/privacy

This is a transfer of your site visitors' personal data to a third-party service; make sure this is covered by your own site's privacy policy.

The plugin itself does not otherwise store submitted form data — only the bot token, chat IDs, your message templates, and a short log of delivery *errors* (which does not include submitted field values).

== Donate ==

If you find this plugin useful, please consider supporting its development.

https://buymeacoffee.com/rad181

== Changelog ==

= 1.0.4 =
* Renamed all internal identifiers to a 4+ character prefix (rnft_/RNFT_) to avoid naming collisions with other plugins
* Removed "Tested up to" from the plugin header — declared only in readme.txt now, as required
* Documented the Telegram Bot API as an external service, with data sent and links to Telegram's Terms of Service and Privacy Policy

= 1.0.3 =
* Lowered minimum required PHP from 7.4 to 7.2 (no code in this plugin actually needs 7.4)

= 1.0.2 =
* Renamed to Rnotifier for Telegram (was Telegram Bot Connector / Rad Notifier for Telegram)
* Removed unnecessary load_plugin_textdomain() call

= 1.0.0 =
* Initial release
