How to delivery email to sales generated via web_user?


I have a flask app that generate subscriptions based on sale_subscription web_user modules, I want that when a invoice is posted send an email to notify to the user. I’m using the notification_email, configure it correctly but have a question: the user has a valid email but not a contact mechanism in party.

In these line I see that need to have a email contact mechanism to get the email, but it is doesn’t create before (almost not with web_user module).

How to delivery the email to the user using the registered on web_user module? Do I need to create a contact_mechanism with the email of web_user? Wouldn’t that duplicate the information?

Thanks in advance!

For a similar case, we added the email of the web user also as contact mechanism on the linked party.
We had some code on the web application to ensure that if the web user email is changed, the contact mechanism is also changed. But we could also allowed the user to add more than one email and manage which contact mechanism to use.

1 Like

Another way would be to add a web_user field on the invoice (could be a Function) so the notification could be based on it.

I added a web_user as function field in account invoice and it works fine! Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.