Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Need some input and advice on a job that I am currently building.
I am querying a local database for requests that came in for a specific user that they need to follow up on since the specific request has been raised multiple times.
From this, I grab the specific user details, pass it to LDAP so I can grab their email address, and then I take all the incoming request, sort them by user, determine how many times I have sent a notice to them before, and then proceed to send them and HTML email listing the specified requests requiring their attention.
The job works pretty well, except for one thing that I need help with.
I have a tJavaRow component that builds the HTML message table that I want to send to the specified user.
Currently the code is:
//Build email template String payload = ((String)globalMap.getOrDefault("mailMessage", "<TABLE border=0 cellspacing=1px>" + "<TR><TD>Member Number</TD><TD>Retention Agent</TD><TD>Followup Request</TD><TD>Followup Date</TD><TD>Followups Logged to date</TD></TR>")); payload = payload + "<TR><TD>" + input_row.Member_Num + "</TD><TD>" + input_row.Retention_Agent + "</TD><TD>" + input_row.Followup_Request + "</TD><TD>" + input_row.Followup_Date + "</TD><TD>" + input_row.Followups_Logged_to_date + "</TD></TR>"; globalMap.put("mailMessage", payload);
This works a charm, and I can pass this along with no issue.
But, what it does is it keeps adding/expanding values to the existing payload;
IE
It will generate the HTML table for the first user perfectly fine.
Member Number Retention Agent Followup Request Followup Date Followups Logged to date 652******* User_1 450******* Thu Aug 22 17:11:07 CAT 2019 2 846******* User_1 450******* Fri Aug 23 11:51:19 CAT 2019 7 849******* User_1 450******* Fri Aug 23 12:30:26 CAT 2019 4 627******* User_1 450******* Thu Aug 22 08:02:13 CAT 2019 2 844******* User_1 450******* Thu Aug 22 12:49:17 CAT 2019 3 842******* User_1 450******* Thu Aug 22 08:44:58 CAT 2019 3 627******* User_1 450******* Fri Aug 23 09:27:15 CAT 2019 2 843******* User_1 450******* Thu Aug 22 11:40:55 CAT 2019 2
The second user onward has all of the previous users request, plus their own, and so on and so forth.
Member Number Retention Agent Followup Request Followup Date Followups Logged to date 652******* User_1 450******* Thu Aug 22 17:11:07 CAT 2019 2 846******* User_1 450******* Fri Aug 23 11:51:19 CAT 2019 7 849******* User_1 450******* Fri Aug 23 12:30:26 CAT 2019 4 627******* User_1 450******* Thu Aug 22 08:02:13 CAT 2019 2 844******* User_1 450******* Thu Aug 22 12:49:17 CAT 2019 3 842******* User_1 450******* Thu Aug 22 08:44:58 CAT 2019 3 627******* User_1 450******* Fri Aug 23 09:27:15 CAT 2019 2 843******* User_1 450******* Thu Aug 22 11:40:55 CAT 2019 2 613******* User_2 450******* Thu Aug 22 13:57:40 CAT 2019 4 843******* User_2 450******* Thu Aug 22 09:51:01 CAT 2019 2 612******* User_2 450******* Thu Aug 22 11:07:07 CAT 2019 2 625******* User_2 450******* Thu Aug 22 16:48:16 CAT 2019 2 744******* User_2 450******* Thu Aug 22 09:39:52 CAT 2019 2 619******* User_2 450******* Fri Aug 23 08:17:40 CAT 2019 2 743******* User_2 450******* Thu Aug 22 17:49:25 CAT 2019 2 843******* User_2 450******* Fri Aug 23 11:16:48 CAT 2019 2 610******* User_2 450******* Thu Aug 22 09:35:53 CAT 2019 2 791******* User_2 450******* Fri Aug 23 10:23:57 CAT 2019 5
Is their a way to reset the "mailMessage" hash map so that it gets regenerated for each user before sending the email message? Each user should only see their own records and requests, not theirs and every one else's.
I'd appreciate any input and suggestions.
Hi,
Could you please share the job layout screenshot to understand how you are using different components in this use case?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved