This question has been flagged
3 Replies
6664 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

Avatar
Discard

what does it mean static file?

Author

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.

Best Answer

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

Avatar
Discard
Author

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.

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