2

I would like to implement a way to send an email notification (containing content of a log note) to all followers of a record for every log note of that record. I would also like to implement a way for email-replies to said email notifications to appear as log notes of that particular record.

What would I need to do to achieve this (at the back-end) or does Odoo already have a quick solution for this? I thought of creating a template, and overriding the _message_subscribe function to send its content as an email. Although I'm not sure how to go about linking email-replies back to the portal as log notes.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ITJ
  • 144
  • 1
  • 13
  • exactly you've to write custom code for this....Secondly if you want to send email to every follower on creating a log note why are you not using email to do so in Odoo? – Adam Strauss Mar 10 '21 at 11:40
  • @AdamStrauss If you have any ideas on how to implement this custom code, please share. Also, isn't choosing whether to receive emails notifications in Odoo (via Discuss module) or outside of it just a setting? – ITJ Mar 10 '21 at 12:21
  • Actually that should be possible by configuring the subtypes of messages. There allready is one for "notifications". Just go into a partner or order or whatever model with the chatter mixin, add a follower and afterwards edit the follower (followers have a little edit/pencil icon in the follower widget). There activate the notification subtype and write a note. Every follower (except the author) of a note with this activated should get an email. – CZoellner Mar 10 '21 at 12:55
  • So in the end this subtype has to be activated by default. And that's where you eventually need a bit of custom code. – CZoellner Mar 10 '21 at 12:55
  • Another example: in projects (project app) you can define followers, which will automatically become followers of every new task in that project. So there you can allready configure that project wise. – CZoellner Mar 10 '21 at 12:58
  • 1
    Oh i just looked into a demo Odoo. You can just activate a subtype as default activated right in the subtype. Just go to Subtypes menu (Settings -> Technical -> Email -> Subtypes) search for "Note" and activate field "default". – CZoellner Mar 10 '21 at 13:01
  • @CZoellner Yeah I think I'd take the comment above as a correct answer. There's really no need to implement anything on the back-end if it's as simple as that. – ITJ Mar 10 '21 at 16:11

1 Answers1

1

One of many solutions to this requirement is to set the mail subtype "Note" as default activated.

Those subtypes can be configured on record follower base. So every User can have it's own subtype configurations.

But to just set a default, this should easily work. I'm not a fan of the requirement at all, but atleast i'm a fan of the solution :-P

Just go to Subtypes menu (Settings -> Technical -> Email -> Subtypes) search for "Note" and activate field "default"

CZoellner
  • 13,553
  • 3
  • 25
  • 38