How send an email to recipient with individual attachment

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

ashok.gosavi
Posts: 2
Joined: Wed May 25, 2016 9:17 am

How send an email to recipient with individual attachment

Post by ashok.gosavi »

Requirement: How to send out an email to multiple receivers/recipients with individual attachment :?:
Case: Target Group (Distribution List) contains 1000 of email ids and everybody should get individual PDF(or any other extension) document. The documents are already generated and placed at shared path.

What I have done: Currently I am having less no of email ids in Target Group, consider 2 email ids. So when I create mailing and click on Send, openemm generates .xml with details like single attachment data, 2 receivers in <receivers> block, and other needed info.

#Approach 1: "Read the single xml and generate the receiver specific xmls" (works for less no of email ids)
I have done java code change which reads the generated xml using DOM (which loads the xml in memory) and creating fresh .xmls for individual receiver with replacing existing attachment data with receiver specific document/attachment data and <receivers> block with single receiver only.
This works fine but for less no of email ids. The issue with this is when we have large no of email ids this approach is not feasible as DOM loads the xmls in memory and it will definitely go in OutOfMemory error.

#Approach 2: Change java code to generate the receiver/individual xml generation with their attachment. (Required approach)
I tried multiple ways to achieve this but could not succeed :x as I am not much clear with what are the changes required and where to do the exact changes. :(

Request you to please help me with this or alteast provide some pointers :idea: on this.
ashok.gosavi
Posts: 2
Joined: Wed May 25, 2016 9:17 am

Re: How send an email to recipient with individual attachmen

Post by ashok.gosavi »

Or tleast provide me any other best approach to implement sending individual email with individual attachment to the receivers
antoinec52
Posts: 1
Joined: Thu Jan 12, 2017 3:13 pm

Re: How send an email to recipient with individual attachmen

Post by antoinec52 »

Hi, i've got the same problem and i would know if you find any solution?
Post Reply