Odoo Help

Welcome!

This community 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.

0

How to schedule a mail from code (openerp7)?

By
Juanjo Algaz
on 6/25/13, 2:24 PM 929 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?

Thanks!

0
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)

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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