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

Send Email with an attachment file

By
scot77844
on 5/25/15, 7:59 AM 619 views

Hi,

I am having a list files in my system files which are getting generated by a cron job. I want a mail to trigger everyday which has to make the generated file as attachment. I am able to send the mails but not able to attach the files. If I am using ir.attachment, I am able to attcach a static file. But I want to attach the file according to date. Please help me with a solution.

Thanks in advance


Regards,

Scot

what does it mean static file?

Temur
on 5/25/15, 9:00 AM

For example, if we are using ir.attachment and give a path, The same file will be sent in all the mails. I stated that as static file. I need to change the attachment file everyday.

scot77844
on 5/26/15, 2:15 AM
0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 5/26/15, 8:12 AM

I guess

It works best if you insert a file into Ir.Attachment object, then the same file can be used to attach in mail...

Note: you can write a logic in such a way that it reads the file from path, inserts into Attachment Object, then attach the same to mail

Thanks for the reply deep. If I do it that way, it will take the same file as attachment for all the mails. But my file changes everyday. For example, I am pulling a report daily which shows the list of sale orders done yesterday. I have to send the mail with that report according to the day. In this case, My file name changes everyday.

scot77844
on 5/27/15, 2:30 AM

Just before sending the mail, you need to attach from the source, if you do so, you will not be sending the same attachment... first attach and then send.. If you do that you will always be sending the new attachment...

deep
on 5/27/15, 2:43 AM

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: 5/25/15, 7:59 AM
Seen: 619 times
Last updated: 5/26/15, 8:12 AM