Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions mail_brand_templates/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
==============================
Brand Specific Email Templates
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:611297e47ca2d8d03a5f199362c393956c1533eafe469a918d6600dc1f8cfd3e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbrand-lightgray.png?logo=github
:target: https://github.com/OCA/brand/tree/15.0/mail_brand_templates
:alt: OCA/brand
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/brand-15-0/brand-15-0-mail_brand_templates
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/brand&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module enhances Odoo's email communication by introducing brand-aware email template management.

**Key Features:**

* **Brand Association with Email Templates:** Provides the functionality to assign a specific brand to individual email templates within Odoo. This ensures that each template is clearly linked to a particular brand identity.
* **Contextual Email Template Filtering:** When sending emails from a specific document (e.g., a Sale Order), the module intelligently filters the available email templates, allowing users to select only those templates that are associated with the same brand as the originating document (if a brand is set on that document).

With this module, you can streamline your email creation process by ensuring that users can easily select and utilize email templates that are consistent with the brand context of their communication.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

Organizations operating with multiple brands often struggle to maintain consistent and accurate brand representation across all customer communications, particularly in automated and transactional emails.

There is a need for a system that can seamlessly apply the correct branding – including logos, sender details, and potentially communication styles – to emails based on the specific brand context, ensuring a unified and professional customer experience. Furthermore, restricting the use of email templates to those aligned with the brand of the originating communication ensures brand compliance and reduces the risk of sending out off-brand or irrelevant content.

Configuration
=============


**Steps to Set a Brand for an Email Template:**


1. **Navigate to Email Templates:**
* Go to **Settings > Technical > Email > Templates**.

2. **Select an Existing Template or Create a New One:**
* **To modify an existing template:** Find the email template you want to brand in the list and click on it to open its form view.
* **To create a new template:** Click on the **Create** button to define a new email template.

3. **Locate the "Brand" Field:**
* In the email template's form view, you will find a field labeled **Brand**. This field is introduced by this module.

4. **Assign a Brand:**
* Click on the dropdown arrow next to the **Brand** field.
* Select the specific brand that you want to associate with this email template from the list.
* If the desired brand is not listed, you may need to create it first.

5. **Save the Email Template:**
* Once you have selected the brand, click the **Save** button to save the changes to the email template.

Usage
=====


**Using Brand-Specific Templates:**

* When sending emails from a document that has a brand associated with it (e.g., a Sale Order with a 'Brand A' set), and you choose to use a pre-defined template, the module will filter the available templates. You will only see templates that are either not associated with any brand or are associated with the same brand ('Brand A' in this example).
* If you manually select a brand in the "Compose Email" wizard, the same filtering logic will apply when choosing an email template.

**Example:**

Let's say you have two brands defined: "Brand A" and "Brand B".

* You create an email template for sending order confirmations and set its **Brand** to "Brand A".
* When a user sends an order confirmation email from a Sale Order that has "Brand A" set, this specific order confirmation template will be available for selection.
* If the Sale Order has "Brand B" set, the "Brand A" order confirmation template will be filtered out, and only templates associated with "Brand B" or no brand will be available.

By associating brands with your email templates, you can ensure that your communication is always consistent with the relevant brand identity.

Known issues / Roadmap
======================

-

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/brand/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/brand/issues/new?body=module:%20mail_brand_templates%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* bosd

Contributors
~~~~~~~~~~~~

* Bosd

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-bosd| image:: https://github.com/bosd.png?size=40px
:target: https://github.com/bosd
:alt: bosd

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bosd|

This module is part of the `OCA/brand <https://github.com/OCA/brand/tree/15.0/mail_brand_templates>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions mail_brand_templates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
20 changes: 20 additions & 0 deletions mail_brand_templates/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 bosd
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Brand Specific Email Templates",
"summary": """
Allows to define email templates specific to a brand.
""",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA), bosd",
"website": "https://github.com/OCA/brand",
"version": "15.0.1.0.0",
"depends": ["mail_brand", "brand"],
"data": [
"wizard/mail_compose_message_view.xml",
"security/mail_template_security.xml",
"views/mail_template.xml",
],
"maintainers": ["bosd"],
}
1 change: 1 addition & 0 deletions mail_brand_templates/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mail_template
10 changes: 10 additions & 0 deletions mail_brand_templates/models/mail_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2025 Bosd
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class MailTemplateExt(models.Model):
_inherit = "mail.template"

brand_id = fields.Many2one("res.brand", "Brand")
21 changes: 21 additions & 0 deletions mail_brand_templates/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

**Steps to Set a Brand for an Email Template:**


1. **Navigate to Email Templates:**
* Go to **Settings > Technical > Email > Templates**.

2. **Select an Existing Template or Create a New One:**
* **To modify an existing template:** Find the email template you want to brand in the list and click on it to open its form view.
* **To create a new template:** Click on the **Create** button to define a new email template.

3. **Locate the "Brand" Field:**
* In the email template's form view, you will find a field labeled **Brand**. This field is introduced by this module.

4. **Assign a Brand:**
* Click on the dropdown arrow next to the **Brand** field.
* Select the specific brand that you want to associate with this email template from the list.
* If the desired brand is not listed, you may need to create it first.

5. **Save the Email Template:**
* Once you have selected the brand, click the **Save** button to save the changes to the email template.
3 changes: 3 additions & 0 deletions mail_brand_templates/readme/CONTEXT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Organizations operating with multiple brands often struggle to maintain consistent and accurate brand representation across all customer communications, particularly in automated and transactional emails.

There is a need for a system that can seamlessly apply the correct branding – including logos, sender details, and potentially communication styles – to emails based on the specific brand context, ensuring a unified and professional customer experience. Furthermore, restricting the use of email templates to those aligned with the brand of the originating communication ensures brand compliance and reduces the risk of sending out off-brand or irrelevant content.
1 change: 1 addition & 0 deletions mail_brand_templates/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Bosd
Empty file.
8 changes: 8 additions & 0 deletions mail_brand_templates/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This module enhances Odoo's email communication by introducing brand-aware email template management.

**Key Features:**

* **Brand Association with Email Templates:** Provides the functionality to assign a specific brand to individual email templates within Odoo. This ensures that each template is clearly linked to a particular brand identity.
* **Contextual Email Template Filtering:** When sending emails from a specific document (e.g., a Sale Order), the module intelligently filters the available email templates, allowing users to select only those templates that are associated with the same brand as the originating document (if a brand is set on that document).

With this module, you can streamline your email creation process by ensuring that users can easily select and utilize email templates that are consistent with the brand context of their communication.
1 change: 1 addition & 0 deletions mail_brand_templates/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-
15 changes: 15 additions & 0 deletions mail_brand_templates/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

**Using Brand-Specific Templates:**

* When sending emails from a document that has a brand associated with it (e.g., a Sale Order with a 'Brand A' set), and you choose to use a pre-defined template, the module will filter the available templates. You will only see templates that are either not associated with any brand or are associated with the same brand ('Brand A' in this example).
* If you manually select a brand in the "Compose Email" wizard, the same filtering logic will apply when choosing an email template.

**Example:**

Let's say you have two brands defined: "Brand A" and "Brand B".

* You create an email template for sending order confirmations and set its **Brand** to "Brand A".
* When a user sends an order confirmation email from a Sale Order that has "Brand A" set, this specific order confirmation template will be available for selection.
* If the Sale Order has "Brand B" set, the "Brand A" order confirmation template will be filtered out, and only templates associated with "Brand B" or no brand will be available.

By associating brands with your email templates, you can ensure that your communication is always consistent with the relevant brand identity.
11 changes: 11 additions & 0 deletions mail_brand_templates/security/mail_template_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<record id="ir_rule_mail_template_allowed_brands" model="ir.rule">
<field name="model_id" ref="mail.model_mail_template" />
<field name="name">Brand Specific Mail Templates</field>
<field name="global" eval="True" />
<field eval="0" name="perm_unlink" />
<field eval="0" name="perm_write" />
<field eval="1" name="perm_read" />
<field eval="0" name="perm_create" />
</record>
</odoo>
Binary file added mail_brand_templates/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading