#1 2008-07-02 09:48:56

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Body of an email

Hello,

I try to send the result of a tFileList in the body of an email.

But I can't do that.
I add a tIterateToFlow, a tFileOutputDelimited, but I can't find how to send a message like that :

"The directory contains" +((Integer)globalMap.get("tFileList_1_NB_FILE")) + "files"
The files are "+ WhatISInTheDelimitedFile or TheFlow


Thanks for your help

P.S : I'm a programmer, I also forgot how to convert an integer to a string in java..... ;-))

P.S 2 : I know that I can have the file as an attachment (and it's work fine), but it's really faster to read the file without to open the attachment....


Uploaded Images

Last edited by olcell (2008-07-02 10:21:51)


THX,
Regards,

Olivier

Offline

#2 2008-07-02 10:26:44

jeremie
Member
Registered: 2008-02-11
Posts: 151

Re: Body of an email

Hi,

what do you want to do ?
what contends your tFileOutputDelimited : name if files or data ?
and in the mail body you want to put the data of files ?

jérémie


Consultant BI Open Source
FRANCE

Offline

#3 2008-07-02 10:41:52

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

jeremie wrote:

Hi,

what do you want to do ?
what contends your tFileOutputDelimited : name if files or data ?
and in the mail body you want to put the data of files ?

jérémie

I want to list the file in a directory (the result of a ftp download) and send it by email.
I never know how much files I will have but more than 10 files.... If I read less than 10 names, I know that the previous process fails.... With the list of the files, I know if its a "serious" or not "error"...

So I tried to put the result of the tFileList in a file and then, I can send the file.
But, putting the list and the number of the files directly in the body of the email will be better....
At this moment, tFileOutputDelimited contains the name of the files and the date of the day (it's just for the test, I can delete this item ;-) ...)


THX,
Regards,

Olivier

Offline

#4 2008-07-02 10:58:57

jeremie
Member
Registered: 2008-02-11
Posts: 151

Re: Body of an email

Ok,

also you can create a globalvariable in a tJava Instead of the tFileOutputDelimited with globalMap.put
efter you ese them in the tSendMail

jérémie


Consultant BI Open Source
FRANCE

Offline

#5 2008-07-02 11:22:53

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

jeremie wrote:

Ok,

also you can create a globalvariable in a tJava Instead of the tFileOutputDelimited with globalMap.put
efter you ese them in the tSendMail

jérémie

Thanks Jeremie, but in 2.4.0, where is the tJava.... I can't find it in the "Processing family"....


THX,
Regards,

Olivier

Offline

#6 2008-07-02 11:26:29

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

olcell wrote:

jeremie wrote:

Ok,

also you can create a globalvariable in a tJava Instead of the tFileOutputDelimited with globalMap.put
efter you ese them in the tSendMail

jérémie

Thanks Jeremie, but in 2.4.0, where is the tJava.... I can't find it in the "Processing family"....

it's in the "Custom Code" section ;-))


THX,
Regards,

Olivier

Offline

#7 2008-07-02 11:33:25

jeremie
Member
Registered: 2008-02-11
Posts: 151

Re: Body of an email

thank's as your services

Regards

jeremie


Consultant BI Open Source
FRANCE

Offline

#8 2008-07-02 14:19:10

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

Hi, I need some help again or not.... If somebody find a better/quicker solution ;-)).

In my tJava_3, I put this code

String var3 = "liste des fichiers3 : ";
var3 = var3 + (globalMap.get("tIterateToFlow_1.row1"));
System.out.println(var3);
globalMap.put("tJava_2_Flot",var3);

I get only "null".

If I remove  ".row1", I get an array.....

I tried with a "main" link, an "On Component ok"....

I also tried with the tJava2 on the tFileList_1 with this code :

String var2 = "liste des fichiers2 : ";
var2 = var2 + globalMap.get("tFileList_1_CURRENT_FILE");
System.out.println(var2);
globalMap.put("tJava_2_Liste_FILE", var2);

But I get only the last file because I always initialize my variable..... and I find the solution : the "context" to create a global variable.... (maybe I say something wrong, then please correct me if it is so...)


When I create the var in the context, with this code in the tJava_2, It's OK!!!!
context.var2 = context.var2 + globalMap.get("tFileList_1_CURRENT_FILE")+"\r\n";
System.out.println(context.var2);
globalMap.put("tJava_2_Liste_FILE", context.var2);




Maybe, it's possible to make it more simple.....


Uploaded Images

Last edited by olcell (2008-07-02 14:19:40)


THX,
Regards,

Olivier

Offline

#9 2008-07-02 14:52:06

jeremie
Member
Registered: 2008-02-11
Posts: 151

Re: Body of an email

Hi,

What do you need 2 tJava, the tJava_2 is just
after you put your tSendMail with a OnSubJobOk
Not necessairy tFileOutputDelimited and tIterateToFlow.

i think not tIterateToFlow_1.row1 but row1.name_file from the shema of the tIterateToFlow
Furthermore the OnComponentOk don't push the schema.

Jeremie


Consultant BI Open Source
FRANCE

Offline

#10 2008-07-02 14:55:54

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

Thanks, I did like you said, the tJava_3 was just for the test ;-)). I removed it when I found the solution....

Thanks for your help.


THX,
Regards,

Olivier

Offline

#11 2008-07-02 15:07:11

olcell
Member
Company: ARDI Rhône-Alpes
Registered: 2006-10-09
Posts: 55
Website

Re: Body of an email

jeremie wrote:

Hi,

after you put your tSendMail with a OnSubJobOk
Not necessairy tFileOutputDelimited and tIterateToFlow.

i think not tIterateToFlow_1.row1 but row1.name_file from the shema of the tIterateToFlow
Furthermore the OnComponentOk don't push the schema.

Jeremie

If I delete the tFileOutputDelimited and tIterateToFlow, it didn't work... I will send the file too and let it like that ;-)))


THX,
Regards,

Olivier

Offline

Board footer

Powered by FluxBB