Hi,
Follow is my code to send email:
@api.multi
def mailmessage(self):
vals ={}
domain = [('name','like','EAR Activation Request')]
template = self.env['email.template'].search(domain, limit=1)
template = template[0]
print(template.email_to)
template.send_mail(self.id, True)
return True
My template is getting all the data correctly from model. However, I need to pass a dynamic data to the template before sending email. Be it email_to or ip_address. Can someone guide me how can I pass these two variables on runtime in my python code before send_mail function so the template pick them?
Thanks