Skip to content
Open
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
99 changes: 99 additions & 0 deletions mail_send_copy/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
======================
Mail - Send Email Copy
======================

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

.. |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%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/18.0/mail_send_copy
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_send_copy
: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/social&target_branch=18.0
:alt: Try me on Runboat

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

This module extends the functionality of Mail Module adding sender in
BBC field to receive a copy of each mail sent by Odoo.

.. warning::

Sender can be different from the current user according email
template in use.

Use Case
--------

This feature can be usefull for users:

- to be sure the mail was sent because Odoo send mail depending of some
partner parameters
- to have the whole conversation if the partner writes an answer and if
mailbox manages thread by object
- to be sure smtp server works

**Table of contents**

.. contents::
:local:

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

- Add the possibility to select if the mail is sent in "Cc" or in "Bcc"
mode.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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/social/issues/new?body=module:%20mail_send_copy%0Aversion:%2018.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
-------

* GRAP

Contributors
------------

- Sylvain LE GAL (https://www.twitter.com/legalsylvain)

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.

This module is part of the `OCA/social <https://github.com/OCA/social/tree/18.0/mail_send_copy>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mail_send_copy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions mail_send_copy/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Mail - Send Email Copy",
"summary": "Send to you a copy of each mail sent by Odoo",
"version": "18.0.1.0.1",
"category": "Social Network",
"author": "GRAP," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"license": "AGPL-3",
"depends": ["mail"],
"installable": True,
}
25 changes: 25 additions & 0 deletions mail_send_copy/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_send_copy
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-11-13 10:48+0000\n"
"PO-Revision-Date: 2019-11-13 10:48+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_send_copy
#: model:ir.model,name:mail_send_copy.model_ir_mail_server
msgid "Mail Server"
msgstr "Serveur d'email"

#~ msgid "Users"
#~ msgstr "Utilisateurs"
19 changes: 19 additions & 0 deletions mail_send_copy/i18n/mail_send_copy.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_send_copy
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_send_copy
#: model:ir.model,name:mail_send_copy.model_ir_mail_server
msgid "Mail Server"
msgstr ""
1 change: 1 addition & 0 deletions mail_send_copy/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_mail_server
36 changes: 36 additions & 0 deletions mail_send_copy/models/ir_mail_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging
from email.utils import COMMASPACE

from odoo import api, models

_logger = logging.getLogger(__name__)


class IrMailServer(models.Model):
_inherit = "ir.mail_server"

@api.model
def send_email(self, message, *args, **kwargs):
do_not_send_copy = self.env.context.get("do_not_send_copy", False)
if not do_not_send_copy:
# Get existing Bcc recipients (if any)
bcc = message.get("Bcc", "")
from_addr = message.get("From", "")

# Combine existing Bcc with From address
if bcc:
all_bcc = COMMASPACE.join([bcc, from_addr])
else:
all_bcc = from_addr

# Set the combined Bcc
if "Bcc" in message:
message.replace_header("Bcc", all_bcc)
else:
message.add_header("Bcc", all_bcc)

return super().send_email(message, *args, **kwargs)
3 changes: 3 additions & 0 deletions mail_send_copy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions mail_send_copy/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)
16 changes: 16 additions & 0 deletions mail_send_copy/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This module extends the functionality of Mail Module adding sender in
BBC field to receive a copy of each mail sent by Odoo.

> [!WARNING]
> Sender can be different from the current user according email template
> in use.

## Use Case

This feature can be usefull for users:

- to be sure the mail was sent because Odoo send mail depending of some
partner parameters
- to have the whole conversation if the partner writes an answer and if
mailbox manages thread by object
- to be sure smtp server works
2 changes: 2 additions & 0 deletions mail_send_copy/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add the possibility to select if the mail is sent in "Cc" or in "Bcc"
mode.
Binary file added mail_send_copy/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