Skip to Content
Menu
This question has been flagged
1 Reply
2251 Views

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?

Avatar
Discard
Author Best Answer

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)

Avatar
Discard
Related Posts Replies Views Activity
3
Jul 21
8195
0
Apr 21
1001
1
Jun 19
3051
0
Jan 23
1476
1
Dec 22
3307