On 02/05/23 12:01, Timo Weber wrote:
Hi, this is about sending emails with templates. Right now there does not seem to exist a default way to send an email with attachments. What would be the best way to achieve this? I found the class DefaultNotificationJobDelegate where the MimeMessage is composed and where you could add an attachment. But I guess it's not so easy to configure the attachements in the template and propagate it all the way to this class. So I thought about extending the DefaultNotificationJobDelegate and more or less hard coding the attachments when creating the message. Can I just have my own ProvisioningContext and have the method notificationJobDelegate(...) return my extended class? Or is there a better way?
Hi Timo, at least for time being, providing your own extension of DefaultNotificationJobDelegate which takes care of attachments is possibly the best solution. All you need is, in your own Maven project sources, to: 1. provide MyNotificationJobDelegate extends DefaultNotificationJobDelegate 2. create and setup a new configuration class by following [1] HTH Regards. [1] https://syncope.apache.org/docs/3.0/reference-guide.html#extending-configuration -- Francesco Chicchiriccò Tirasa - Open Source Excellence http://www.tirasa.net/ Member at The Apache Software Foundation Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail http://home.apache.org/~ilgrosso/