Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1611 มุมมอง

Where can I change in code, so that email_from is changed when I send mail from chatter?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can customize the sender email (email_from) for chatter messages by overriding the message_post method. For example:

class MailThread(models.AbstractModel):

    _inherit = 'mail.thread'


    @api.model

    def message_post(self, **kwargs):

        if not kwargs.get('email_from'):

            kwargs['email_from'] = 'custom_email@example.com'  # Set your custom email address

        return super().message_post(**kwargs)

This will set a custom sender email if one is not provided when posting a message.


Hope it helps

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Any update?

อวตาร
ละทิ้ง

Is this problem solved? More information here: https://101games.io/solar-smash

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 25
1860
2
ส.ค. 25
520
2
มี.ค. 25
1423
1
ก.พ. 25
1792
1
ธ.ค. 24
2291