Page 1 of 1

Sending only the latest attachment, not all existing attachments from the workitem

Posted: Wed Jun 29, 2016 10:16 am
by apugazhenthy
Hi Pavel,

http://cqadmin.org/wiki/Notification_Examples#Sending_Emails_with_Attachments
I have used above example code for sending email with attachment. Thanks for this code, it is working perfectly.

This code sending all attachments present in the workitem but I want to send only the latest attachments (i.e. attachment added during last update) not all attachment updated earlier. so please help me to achieve this requirement.


Many Thanks,
Pugazhenthy A

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Wed Jun 29, 2016 12:46 pm
by Pavel
Hi,

Please check comments in that example. For the attachments that has not been loaded yet, the file name would contain path delimiters. Newly added attachments could be distinguished this way.
Another way would be to compare record to its original using CQ API, and add newly added attachments, if any.

Pavel

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Fri Jul 01, 2016 5:50 am
by apugazhenthy
Pavel wrote:Hi,

Please check comments in that example. For the attachments that has not been loaded yet, the file name would contain path delimiters. Newly added attachments could be distinguished this way.
Another way would be to compare record to its original using CQ API, and add newly added attachments, if any.

Pavel


Thank you Pavel :) ...

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Tue Jul 05, 2016 10:36 am
by apugazhenthy
Hi Pavel,

It sending only latest attachments added in the current session which worked after I removed else part(which is adding all existing attachments) from the example code provided.

but now the problem is after I connected RTC(Rational Team Concert) to CQ, if I add any attachments in RTC it get synched to CQ but not sending with mail. If I enabled that else condition again(which I removed earlier for send only latest attachments) then it sending all the attachments as well as current session attachment added through RTC.

I want to send only the latest attachments which added from RTC in the current update. Please help me for this requirement.

Many thanks,
Pugazhenthy A

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Tue Jul 05, 2016 11:14 am
by Pavel
Hi,

Should I draft a contract?

Thank you,
Pavel

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Wed Jul 06, 2016 2:08 am
by apugazhenthy
Hi Pavel,

Is this required any major things to do? or else simple code changes is required then I will do my own.please give me some hints.



Thank You,
Pugazhenthy A

Re: Sending only the latest attachment, not all existing attachments from the workitem

Posted: Wed Jul 06, 2016 9:12 am
by Pavel
Hi,

It would require some codding and testing. If file path approach does not work, I would try to implement comparison of the current entity object attachments with attachments of the same record entity stored in the database (accessible with LoadEntity session object method).

Pavel