Saturday, 13 April 2019

Sending email via Python

Sending email via Python
To send the mail from the python,
Try the following coding.

template_obj = self.env['mail.mail']
template_data = {
                'subject': 'Due Invoice Notification : ' + current_date,
                'body_html': message_body,
                'email_from': sender,
                'email_to': ", ".join(recipients)
                }
template_id = template_obj.create(template_data)
template_obj.send(template_id)


Also give the mail as depends in manifest file

No comments:

Post a Comment