Everything works but only for the subscriber on the first row.
What should I do to send an email to every row?
This is the code:
protected override void OnBarUpdate()
{
string path = NinjaTrader.Cbi.Core.UserDataDir + usersFile;
// This command clears all data from the output window.
ClearOutputWindow();
ToField="";
// This command will just print a blank line in the output window.
Print("MorningSignals_Email_Service");
string readText = File.ReadAllText(path);
string [] split = readText.Split(new Char [] { ',' , '\n'});
int splitCounter = 0;
int rows = 0;
ToList = "";
foreach (string s in split)
{
if (s.Trim() != "")
{
splitCounter++;
Print(splitCounter.ToString() + ':' + s);
if (splitCounter == 1) field1 = s;
if (splitCounter == 2)
{
field2 = s;
if(ToList!="") ToList=ToList + ", " + s;
else if(ToList=="") ToList=s;
}
if (splitCounter == 3) field3 = s;
if (splitCounter == 4) field4 = s;
}
}
Print("ToList: "+ToList);
Print("rows: "+ rows);
}
string[] ToListArray = ToList.Split(',');
Comment