Hello,
I'm trying to send attachments from an issue via an email notification which is triggered by a workflow transition. I want to do this without any plugins.
So I've looked into the velocity templates and the available context. From my current understanding it is not possible to do that with the methods at hand. Given the fact that we have the 'MailAttachmentsManager' interface available and that it has a method to attach files to email-messages(but requires an unavailable Class called 'MailAttachment'), i looked into the $attachments-list that is provided. I interpret this to be the output of the AttachmentManager-class.getAttachments() method(which we currently cant access ourselves). So I'm looking for a way to 'load' two new classes, which are 'MailAttachments' and 'DefaultAttachmentManager' oder two interfaces, which are called 'MailAttachment' and 'AttachmentManager', and then stream the attachments to MailAttachment to create a MailAttachment-object, which can then again be used by MailAttachmentsManager to add the files to the email-message.
I've found a hacky-style of making the 'loading'-part possible, by using the .getClasses().forName().newInstance() method. It seems to work for users who wanted to achieve something similar, but unfortunately I do get Exception-errors.. I'm a little bit lost.
So any advice is highly appreciated. Is it possible at all without writing/using a plugin?
If yes: Am I on the right path, or totally overcomplicating things?
If not: That would also be good to know!
Cheers! :)