Odoo Help


How to schedule a mail from code (openerp7)?

Juanjo Algaz
on 6/25/13, 2:24 PM 1,386 views

Hi, on openerp61 we have the schedule_with_attach, to create and schedule a mail from code. Now this function dont exists more, (openerp7).

What function can use to schedule a mail from code or and action server (python code) now?


Juanjo Algaz
On 7/15/13, 1:20 PM

Ok, with this code, I can send one email from one action server to automatic reply to a issue ticket.

email_to = object.email_from
mail_mail = self.pool.get('mail.mail')
asunto = 'TICKET %s EN CURSO' % (object.id) 
body = 'Estimado cliente, hemos recibido su solicitud de soporte %s.' % (object.id) 
body += '<br/>' 
body = 'En breve, uno de nuestros técnicos se pondrá en contacto con usted.'
body += '<br/>' 
body += 'Operación efectuada en fecha %s' % time.ctime() 
mail_ids = []
mail_ids.append(mail_mail.create(cr, uid, {
                    'email_from': "soporte@malagatic.es",
                    'email_to': email_to,
                    'subject': asunto,
                    'body_html': '<pre>%s</pre>' % body}, context=context))
mail_mail.send(cr, uid, mail_ids, context=context)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/25/13, 2:24 PM
Seen: 1386 times
Last updated: 3/16/15, 8:10 AM