Posts

Showing posts with the label email with attachment in hybris

How to support multiple toAddress CC BCC and attachments in hybris email?

Scenario We want to send email to multiple addresses, also want to support the email attachments. Unfortunately, it's not there in OOTB. Solution We have to define our custom attributes in BusinessProcess itemType to stores the values and access it in the later process. Also, we have to override generate method of DefaultEmailGenerationService, as it is responsible to generate EmailMessageModel. We will set attachments and other fields to generated emailMessageModel only. Let's see it step by step.

1) Define custom attribute in BusinessProcessModel To do so, you have to define attributes like below in your *-items.xml file. Now build your server(ant clean all), which will generate BusinessProcessModel with our custom attributes, which can be accessed using setter and getter methods.