18.01.2023, 13:30
Hi in this for function, the texts are stringed together and sent on an email. This is for the alarm window
But what do I have to add in the end to get a new line between each alarm entry?
I tried to send mail in the for function directly but only the last alarm is then sent by email for some reason. Why is that?
what do i use to get the number for the current row in the rows function?
What do I use to get the total number of rows in the table?
maileksport = " "
for _, row in ipairs(rows) do
alstmaxid = math.max(alstmaxid, row.id)
alertdate = os.date('%c', row.alerttime)
maileksport = maileksport .. ( "Alarmnr \n \n " .. " - " .. ((alertdate .. " - ".. row.alert )) ) --- here i want a new line
-- mail(mailalarm, (lokasjon .. " - ALARM " ), alertdate .. " - ".. row.alert ) --- this only send the last entry in table as alarm
end
But what do I have to add in the end to get a new line between each alarm entry?
I tried to send mail in the for function directly but only the last alarm is then sent by email for some reason. Why is that?
what do i use to get the number for the current row in the rows function?
What do I use to get the total number of rows in the table?
maileksport = " "
for _, row in ipairs(rows) do
alstmaxid = math.max(alstmaxid, row.id)
alertdate = os.date('%c', row.alerttime)
maileksport = maileksport .. ( "Alarmnr \n \n " .. " - " .. ((alertdate .. " - ".. row.alert )) ) --- here i want a new line
-- mail(mailalarm, (lokasjon .. " - ALARM " ), alertdate .. " - ".. row.alert ) --- this only send the last entry in table as alarm
end