Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dears,
I am trying to get data from MySQL and eventually send it as html email messsage.
I read many articles here but dont understand issue with my flow.
I am getting results, but email content dont show "FirstName" while email sending is fine.
In context option i added one string as "Fname" and in my table i have one "FirstName" column.
in tJavaRow components i added this code :
context.FName= input_row.FirstName;
And then in tSendMail message added :
context.FName
Please advise what i am doing wrong. Thanks
1. I saw in another post context variable so i am using them not specific reason.
2. I used System.out.printf and in java debug i can see that everything is printing, msg variable have complete html, though table output is the number of rows, like printing multiple times, but this can be controlled.
3. Now the main issue is null in email, below are my mail settings.
In Advance settings selected Html as MIME, and encoding is ISO-----.
Did you hange anything in your initial job design?
Else, add a tJava component with the following code before your tSendMail:
System.out.println(((String)globalMap.get("mailMsg")));If it print something, everything is OK, you have the mail content you want.
Dear TRF,
Sorry couldnt get "Did you hange anything in your initial job design?". But results of data are ok.
i added tJava as you suggested and getting null again. Please check below screenshot.
Is it possible it have anything to do with this "onSubJobOk"?
Update:
in tJavaRow i added System.out.println(msg); then output is as below.
Here is my tJavaRow (with correction on html syntax):
String msg = ((String)globalMap.getOrDefault("mailMsg", "<table><tr><th>ID</th><th>FirstName</th><th>LastName</th></tr>"));
msg = msg +
"<tr>" +
"<td>" + input_row.Id + "</td>" +
"<td>" + input_row.FirstName + "</td>" +
"<td>" + input_row.LastName + "</td>" +
"</tr>";
globalMap.put("mailMsg", msg);and here is what tJava print on the console:
[statistics] connecting to socket on port 3767
[statistics] connected
.--+---------+--------.
| tLogRow_40 |
|=-+---------+-------=|
|Id|FirstName|LastName|
|=-+---------+-------=|
|1 |AAA |BBB |
|2 |ABC |DEF |
|3 |DEF |GHI |
'--+---------+--------'
<table><tr><th>ID</th><th>FirstName</th><th>LastName</th></tr><tr><td>1</td><td>AAA</td><td>BBB</td></tr><tr><td>2</td><td>ABC</td><td>DEF</td></tr><tr><td>3</td><td>DEF</td><td>GHI</td></tr>
[statistics] disconnected
Do you have synchrnized your tJavaRow schema?
If not, do it and retry.
Yes, finally its working. Thank You
Still not sure what the issue was, My schema was sync, maybe html, but good that its working, i got email with proper table now. now i just need to modify html.
Great!