Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2928 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 21
9073
0
dub 21
1516
1
čvn 19
3482
1
bře 25
1551
0
led 23
1934