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

Is it possible to change the sender address for all emails sent via chatter of a certain model? If so, how can I do it?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Fixed:

class TheModel(models.Model):

    ...

    _inherit = ['mail.thread', 'mail.activity.mixin']

    ...

    @api.multi
    @api.returns('self', lambda value: value.id)
    def message_post(self, body='', subject=None, message_type='notification', **kwargs):
        kwargs['email_from'] = "REALMAIL <realmail@domain.com>"

        return super(TheModel, self).message_post(body, subject, message_type, **kwargs)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 21
9067
0
เม.ย. 21
1493
1
มิ.ย. 19
3479
1
มี.ค. 25
1549
0
ม.ค. 23
1919