Send an email using a template

Create a function in your model:

@api.multi
def send_email_notification(self):
    self.ensure_one()
    template_obj = self.env.ref('module_name.email_template_id')
    template_obj.send_mail(self.ids[0], force_send=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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.