cancel
Showing results for 
Search instead for 
Did you mean: 

'content' in mail message

Former Member
0 Kudos

I am using receiver mail adapter. Everything is working fine. Mail content has several fields, which are concatenated into 'content'. But the users want to see the content of the email in several lines (rather than one string). I tried to change the occurrence of node 'content' in mail message, but it did not work.

Any idea how it can work?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi !

You can use the following UDF to create a new line in your content.

Former Member
0 Kudos

public String insertNewLine(String input1, Container container) throws StreamTransformationException{

StringBuffer workArea=new StringBuffer();

workArea.append(input1);

workArea.append("\n");

String result=new String(workArea);

return result;

}

Use can pass the content of the mail here.

Former Member
0 Kudos

Thanks... it worked just perfect for my requirement.

Former Member
0 Kudos

Hi,

I tested yiur suggested solution and it worked fine for 3 lines. But when I tried it with 10 lines (which is my actual requirement), it is not forcing line split after line 3. below is the code of mu UDF. Can you please check this and suggest:

StringBuffer workArea=new StringBuffer();

workArea.append(var1);

workArea.append("\n");

workArea.append(var2);

workArea.append("\n");

workArea.append(var3);

workArea.append("\n");

workArea.append(var4);

workArea.append("\n");

workArea.append(var5);

workArea.append("\n");

workArea.append(var6);

workArea.append("\n");

workArea.append(var7);

workArea.append("\n");

workArea.append(var8);

workArea.append("\n");

workArea.append(var9);

workArea.append("\n");

workArea.append(var10);

workArea.append("\n");

String result=new String(workArea);

return result;

Former Member
0 Kudos

Hi !

Instead of using 10 line coding for making 10 newlines better u can change my above coding as given below. Try this i think this will help u.

public String insertNewLine(String input1,String input2,String input3,String input4,String input5,String input6,String input7,String input8,String input9,String input10,Container container) throws StreamTransformationException{

StringBuffer workArea=new StringBuffer();

workArea.append(input1"\n"input2"\n"input3"\n"input4"\n"input5"\n"input6"\n"input7"\n"input8"\n"input9"\n"input10);

workArea.append("\n");

String result=new String(workArea);

return result;

}

Regard's

Preethi.

Former Member
0 Kudos

I dont think the string you suggested would work as I got syntax error. I however tried this one, bit it is still coming up with same results ie split happens only upto 3 lines and the rest 7 lines are concatenated.

workArea.append(var1"\n"var2"\n"var3"\n"var4"\n"var5"\n"var6"\n"var7"\n"var8"\n"var9"\n"var10);

workArea.append("\n");

Any suggestions

Former Member
0 Kudos

HI!

I have missed the '+' symbole between "\n" and the variable added it and try. Add it for each variable take the input1 as an example and try it.Hope it will help u.

StringBuffer workArea=new StringBuffer();

workArea.append(input1"\n"input2"\n"input3"\n"input4"\n"input5);

workArea.append("\n");

String result=new String(workArea);

return result;

Regard's

Preethi.

Former Member
0 Kudos

I am still struggling with it. Below is complete code. Split is happening only upto 3 lines and all remaining ones are in a continous string. I appreciate your help. Can you sugegst what am I missing?

StringBuffer workArea=new StringBuffer();

workArea.append(var1 + "\n" + var2 + "\n" + var3 + "\n" + var4 + "\n" + var5 + "\n" + var6 + "\n" + var7 + "\n" + var8 + "\n" + var9 + "\n" + var10);

workArea.append("\n");

String result=new String(workArea);

return result;

Former Member
0 Kudos

Hi!

I have created a scenario and i have tested it fro ten var it is working fine. Can u pls check the mapping are u pls attach the screen shot of your mapping. there is no error in the UDF.

Regard's

Preethi.

Answers (1)

Answers (1)

arijit_mukherjee2
Participant
0 Kudos

This message was moderated.