| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 1374 |
| Technical Name |
sm_telegram_template |
| License | OPL-1 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 1374 |
| Technical Name |
sm_telegram_template |
| License | OPL-1 |
Telegram Templates & Inline Buttons
Create reusable Jinja2 message templates with inline keyboard buttons, PDF attachments & live preview
Module Video Overview
Features
1 Dynamic Jinja2 templates
Build reusable message templates powered by Jinja2. Use dynamic variables like |
|
|
2 Inline keyboard buttonsAdd clickable URL buttons directly in your Telegram messages - View Order, Pay Invoice, Visit Website. Configurable per template with row management. URLs support Jinja2 variables for dynamic links. |
3 Send with templateSelect a template from the Send Telegram wizard and the message is instantly rendered with the current record's data. Pick recipients, review the preview, and send - all from the chatter. |
|
|
4 PDF report per templateAttach a QWeb PDF report directly in the template configuration. On send, the report is auto-generated for the current record and delivered alongside the text message - Quotation, Invoice, Delivery Slip, and more. |
5 Default template per modelSet a default template for each Odoo model. When users open the Send Telegram wizard from a Sale Order, the SO Confirmation template is pre-selected automatically - saving time and ensuring consistency. |
|
And much more...
Live PreviewSee a real-time preview of your template body. Verify variables and formatting before sending to recipients. |
Markdown & HTMLFormat messages in Markdown or HTML. Bold, italic, links, code blocks - all supported natively by Telegram. |
Per-Partner RenderingWhen sending to multiple recipients, each partner gets their own personalized message rendered from the template. |
Dynamic Button URLsButton URLs support Jinja2 variables. Use portal URLs like |
Button Row ManagementOrganize inline buttons into rows. Mark any button as "New Row" to start a new line - up to 3 buttons per row. |
Template per LogEvery sent message log records which template was used, making it easy to audit and trace message history. |
Model-Scoped TemplatesTemplates are linked to specific models. Only relevant templates appear in the wizard based on the current document type. |
Active/InactiveArchive unused templates without deleting them. Inactive templates are hidden from the wizard but can be restored anytime. |
3 Demo TemplatesComes with ready-to-use templates for Sale Order, Purchase Order, and Invoice - complete with inline buttons and PDF reports. |
Support
We provide free bug fixes and updates for all our modules. If you need help, please submit a support request through the Odoo Apps support page. Our team is always ready to assist you.
Telegram Templates & Inline Buttons - Documentation
Table of Contents
1. Overview
This module adds reusable message templates and inline keyboard buttons to the Telegram Integration ecosystem. Templates use the Jinja2 engine to render dynamic, per-partner messages with data from any Odoo record.
Depends on: Telegram Integration Core - Send Messages (sm_telegram_core)
2. Installation
- Make sure sm_telegram_base and sm_telegram_core are already installed.
- Upload the sm_telegram_template folder to your custom addons directory.
- Restart Odoo and update the apps list.
- Search for "Telegram Templates & Inline Buttons" and click Install.
Note
Three demo templates are created on install: SO Confirmation, PO Notification, and Invoice Reminder.
3. Creating a Template
Navigate to Telegram > Message Templates > New.
Fields
| Template Name: | A descriptive name (e.g. "SO Confirmation"). |
|---|---|
| Applies To: | The Odoo model this template is for (e.g. sale.order). |
| Format: | Choose Plain Text, Markdown, or HTML. |
| Active: | Uncheck to archive a template without deleting it. |
| Message Body: | The Jinja2 template body. Available variables:
|
| Attach Report: | Optionally attach a QWeb PDF report that will be auto-generated on send. |
| Include Buttons: | |
Enable to show the inline keyboard button editor. |
|
Example Template Body
*Order Confirmation* 🎉
Hello *{{ partner.name }}*,
Your order *{{ object.name }}* has been confirmed!
📦 Items: {{ object.order_line | length }} lines
💰 Total: {{ "%.2f" | format(object.amount_total) }} {{ object.currency_id.name }}
Thank you for your business!
_{{ company.name }}_
4. Inline Keyboard Buttons
When Include Buttons is enabled, you can add clickable URL buttons that appear below your Telegram message.
Fields
| Button Text: | The label displayed on the button (e.g. "View Order"). |
|---|---|
| URL: | The URL the button links to. Supports Jinja2 variables. The module automatically prepends web.base.url if the URL is relative. |
| Sequence: | Controls the order of buttons. |
| New Row: | Check to start this button on a new row. Maximum 3 buttons per row. |
Example Button URL
{{ object.get_portal_url() }}
This renders to the portal link of the current record (e.g. /my/orders/50). The module auto-converts it to an absolute URL like https://erp.company.com/my/orders/50.
5. Default Template per Model
You can set a default template for each model so it is pre-selected when users open the Send Telegram wizard.
- Navigate to Telegram > Configuration > Model Configuration.
- Open the config for the desired model (e.g. Sale Order).
- Set the Default Template field to your preferred template.
When a user clicks Send Telegram from a Sale Order chatter, the SO Confirmation template will be automatically loaded with the rendered message.
6. Sending with Templates
- Open any record that has Telegram enabled (e.g. a Sale Order).
- Click Send Telegram in the chatter.
- The wizard opens with the default template pre-selected (if configured).
- The message body is instantly rendered with the current record's data.
- Select recipients, review the message, and click Send.
The template body is rendered per-partner, so each recipient gets a personalized message with their own name.
7. Template in Message Logs
Every sent message records which template was used. You can filter and group message logs by template in Telegram > Message Logs.
8. Jinja2 Reference
Available Variables
| Variable | Description |
|---|---|
| object | The current Odoo record |
| partner | The recipient res.partner |
| user | The current res.users (logged-in user) |
| company | The current res.company |
Useful Expressions
{{ object.name }} - Record name
{{ partner.name }} - Recipient name
{{ company.name }} - Company name
{{ object.amount_total }} - Numeric field
{{ "%.2f" | format(object.amount_total) }} - Formatted number
{{ object.date_order.strftime('%d %b %Y') if object.date_order else '-' }}
{{ object.order_line | length }} - Count of lines
{{ object.get_portal_url() }} - Portal link
9. Troubleshooting
Template syntax error
If you see a "Template syntax error at line X" message, check your Jinja2 syntax. Common mistakes:
- Missing closing }}
- Using {% if %} without {% endif %}
- Accessing a field that does not exist on the model
Button URL rejected
Telegram requires absolute URLs starting with http:// or https://. The module automatically prepends web.base.url for relative URLs like /my/orders/50. Make sure your web.base.url system parameter is set correctly.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module