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


Hi Dears,


I am using Odoo 10. I am able to send the mail using python code. Now my requirement is to send two buttons approve and reject inside the mail. When user clicks approve button then the actual record in the database should approve. And reject button should also work in the same manner. How can I achieve this plz help. I tried below link

https://www.odoo.com/forum/help-1/question/how-to-approve-a-record-through-email-120980

I want to know what we have to send in href of a button or link. Then how will it call the appropriate function in model or controller to do some task there.




 


Avatar
Discard
Best Answer

Hi,

In the email template, you must send a dynamically link e.g.: http://localhost:8069/web/reset_password?token=qvNvtQUjoB4oiOBrWcjs&db=odoo12e_english and just add a controller to check when an user click the button in his inbox email.

e.g.:

<a href="${object.signup_url}" style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
    Accept invitation
</a>
@http.route('/web/reset_password', type='http', auth='public', website=True, sitemap=False)
def web_auth_reset_password(self, *args, **kw):
# Your code here...

Best regards!

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 22
1122
0
Sep 21
1262
2
Apr 20
3921
1
Apr 24
260
1
Nov 19
4401