This question has been flagged
3 Replies
2368 Views

Hi, i have implemented email functionality for modules when event is triggered, right now am trying to push mails to mails pool , after that i need to send mails from spool , is there any concept of pushing mails to spool in odoo framework ??, can any one tell me where can i find it 

Avatar
Discard
Best Answer

You can create mail.message without sending, also you could marked with some field as a tag, then using a cron action you could send those emails in a disconected way using your conditions, etc

Avatar
Discard
Author

HI Axel Thanks for response, i got this by mail_values={ 'email_from': employeeEmail, 'email_to': employeeEmail, 'subject': 'Leave Status', 'body_html': 'HI %s'% employeeName +'


Leave Type: %s' % statusName + '


No.of days: %s'%record.number_of_days_temp+'


The status of the leave you''ve applied for the period %s'% record.date_from+'TO %s' %record.date_to +'has been changed to %s'% record.state , 'auto_delete': True, 'type': 'email', } mail_obj = self.pool.get('mail.mail') msg_id = mail_obj.create(cr, uid,mail_values, context=context) msg_obj = self.pool.get('mail.message') msg_obj.create(cr, uid, mail_values)

You do not need the mail.mail create just the message, then create a cron definition to check for those messages not delivered and use a mail.mail create with values {'mail_message_id': mail_message_id} and call the method send on mail.mail to deliver the mail.message

Author Best Answer

HI Axel Thanks for response,

i got this by

mail_values={

'email_from': employeeEmail,

'email_to': employeeEmail,

'subject': 'Leave Status',

'body_html': 'HI %s'% employeeName +'

Leave Type: %s' % statusName + '

No.of days: %s'%record.number_of_days_temp+'

The status of the leave you''ve applied for the period %s'% record.date_from+'TO %s' %record.date_to +'has been changed to %s'% record.state , 'auto_delete': True, 'type': 'email', }

mail_obj = self.pool.get('mail.mail')

msg_id = mail_obj.create(cr, uid,mail_values, context=context)

msg_obj = self.pool.get('mail.message')

msg_obj.create(cr, uid, mail_values)

Avatar
Discard