Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1618 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Any update?

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 25
1867
2
thg 8 25
525
2
thg 3 25
1424
1
thg 2 25
1798
1
thg 12 24
2296