details:   https://code.tryton.org/tryton/commit/fb2fc080451d
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Apr 17 07:42:34 2026 +0200
description:
        Call super in channel email methods extended by inbound email module
diffstat:

 modules/inbound_email/ir.py |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 75fc1c55fc45 -r fb2fc080451d modules/inbound_email/ir.py
--- a/modules/inbound_email/ir.py       Thu Apr 16 18:09:30 2026 +0200
+++ b/modules/inbound_email/ir.py       Fri Apr 17 07:42:34 2026 +0200
@@ -41,13 +41,15 @@
 
     @classmethod
     def _email_channel(cls, email):
+        channel = super()._email_channel(email)
         channels = []
         if (channel_id := _get_channel_identifier(email)):
             channels = cls.search([('identifier', '=', channel_id)])
-        return None if len(channels) != 1 else channels[0]
+        return channel if len(channels) != 1 else channels[0]
 
     @classmethod
     def _email_content(cls, body):
+        body = super()._email_content(body)
         return '\n'.join(itertools.takewhile(
                 lambda l: REPLY_LINE not in l,
                 body.splitlines()))
@@ -60,9 +62,10 @@
 
     @classmethod
     def _email_reply_to(cls, message):
+        reply_to = super()._email_reply_to(message)
         base = config.get(
             'inbound_email', 'chat_reply_to',
-            default=config.get('email', 'from'))
+            default=reply_to or config.get('email', 'from'))
         local_part, domain_part = base.split('@', 1)
         if '+' in local_part:
             local_part, _ = local_part.split('+', 1)
@@ -71,6 +74,7 @@
 
     @classmethod
     def _email_body(cls, message):
+        body = super()._email_body(message)
         with Transaction().set_context(language=message.channel.language):
             above_msg = gettext('inbound_email.msg_reply_above')
-            return f'{REPLY_LINE}\n{above_msg}\n\n{message.content}'
+            return f'{REPLY_LINE}\n{above_msg}\n\n{body}'

Reply via email to