Send an email using a template

mail

Create a function in your model:

@api.multi
def send_email_notification(self):
    self.ensure_one()
    ir_model_data = self.env['ir.model.data']
    template_obj = self.env.ref('abc.email_template')
    template_obj.send_mail(self.ids[0], force_send=True)
    return True

call the function by the following XML code:

<button name="action_email_notification" string="Send Email Notification" type="object" class="oe_highlight" />

Leave a Reply

Your email address will not be published. Required fields are marked *