Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am able to send html based email that contains one single table via tsendemail. I have another table for record counts that I would like to send in the same email.
I have created two mail messages and here is what my tsendemail looks like:
"Results are : \n" + ((String)globalMap.get("mailMessage")) + "\n Record Counts : \n" + ((String)globalMap.get("mailMessage_two"))
However the second email message is getting appended to the last cell of the first table instead of a separate table.
here is tJavaRow_1:
String msg = ((String)globalMap.getOrDefault("mailMessage", "<TABLE name=b border=1 cellspacing=1px>" + "<TR><TD>STEP</TD><TD>DATETIME</TD></TR>"));
msg = msg + "<TR><TD>" + input_row.Step + "</TD><TD>" + input_row.Timestamp + "</TD></TR>";
globalMap.put("mailMessage", msg);
tJavaRow_2:
String msg_two = ((String)globalMap.getOrDefault("mailMessage_two", "<TABLE name=a border=1 cellspacing=1px>" + "<TR><TD>S</TD><TD>D</TD></TR>"));
msg_two = msg_two + "<TR><TD>" + row4.Timestamp + "</TD><TD>" + row4.Label + "</TD></TR>";
globalMap.put("mailMessage_two", msg_two);
I have attached a screenshot of the flow.
Here is the resulting email at the moment:
Any thoughts on how can I get the second table to print out separately?
Thanks
That did not work.
However I was able to make it work by adding </Table> within tsendmail message body.
"Results are : \n" + ((String)globalMap.get("mailMessage")) + "</TABLE>" + "\n" + "\n" + "Record Counts : \n" + ((String)globalMap.get("mailMessage_two"))
Thanks for the idea. It was helpful.
This is not a Talend question at all but an HTML question, but I will answer it anyway.
You need an end table tag after the first message. You should put one after the second message too for best practice.
...
input_row.Timestamp + "</TD></TR></table>";
globalMap.put("mailMessage", msg);
...
msg_two = msg_two + "<TR><TD>" + row4.Timestamp + "</TD><TD>" + row4.Label + "</TD></TR></table>";
...
That did not work.
However I was able to make it work by adding </Table> within tsendmail message body.
"Results are : \n" + ((String)globalMap.get("mailMessage")) + "</TABLE>" + "\n" + "\n" + "Record Counts : \n" + ((String)globalMap.get("mailMessage_two"))
Thanks for the idea. It was helpful.