Hi,
Suppose I have created a button on the header on customer invoice. If I click that button I want to send an email to that customer which contains a link to that customer invoice.
Let say my button name is send_email
def send_email(self):
subject = 'Commercial Invoice'
recipients = self.customer.email
message_body = "Here I want to send the link"
template_obj = self.env['mail.mail']
template_data = {
'subject': subject,
'body_html': message_body,
'email_to': recipients
}
template_id = template_obj.create(template_data)
template_obj.send(template_id)
template_id.send()
Please suggest any solution to send the link of that document which is currently open in an email.