You can try the following:
template = self.env['email.template'].search[('name', '=', 'Name of email template'))
if not template:
raise exceptions.Warning("Email template not found!")
Setting force_send to True will immediately send the email, whereas if you set force_send to False, the mail will push to the mail queue and be sent later (30min intervals) by a cron job.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/7/15, 9:01 AM|
|Seen: 508 times|
|Last updated: 7/10/15, 4:53 AM|