A new data set is added every day (except weekends)

Code: Select all
$body =
<title></title>
<br />
<title></title>
<br />
<title></title>
<table border="0" cellpadding="2" cellspacing="2" style="width: 702px; text-align: left; margin-left: auto; margin-right: auto;">
<tbody>
<tr>
<td style="text-align: center;">
</td>
<td style="text-align: center;">1F3
</td>
<td style="text-align: center;">
</td>
</tr>
<tr>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
</tr>
<tr>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
</tr>
<tr>
<td style="text-align: center;">Sorte
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">Sorte
</td>
</tr>
<tr>
<td style="text-align: center;">1W11
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">1W21
</td>
</tr>
<tr>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
</tr>
<tr>
<td style="text-align: center;">Gewicht nach Trocknung
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">Gewicht nach Trocknung
</td>
</tr>
<tr>
<td style="text-align: center;">1W13
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">1W23
</td>
</tr>
<tr>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
<td style="text-align: center;">
</td>
</tbody>
</table>
$subject = "Email XYZ #lieferdatum#";
$from_name = "nuBuider";
$from_address = "info@xxx.de";
$to = "info@3xxx.de";
$cc = "";
$bcc = "";
nuSendEmail($to, $from_address, $from_name, $body, $subject, [], true, $cc, $bcc);
Code: Select all
$body = '
your code here ....
</table>
';
kev1n wrote:Set up a cron job / scheduled job and run nucall_ext.php which then executes a php procedure.
More information can be found in the code library
(nucall_ext.php is already included in v4.5.)
kev1n wrote:Hi,
Use nuRunQuery() and db_fetch_object() to retrieve the data with the latest date.
Then, instead of using Hash Cookies in your HTML code, which only work when a record is open, use variables/placeholders in your HTML code which are replaced with the values from the result set.
I can well imagine that this is not entirely clear. I will try to provide a bit more info tomorrow.
Code: Select all
// Select the row with the latest date
$s = "
SELECT column1, column1
FROM your_table
ORDER by column_date desc LIMIT 1
";
$t = nuRunQuery($s);
$r = db_fetch_object($t)
$column1 = $r->column1;
$column2 = $r->column2;
$body = 'Hello, <br><br> $column1, $column2';
// Replace the variables since $body string is wrapped in single quotes:
$body = str_replace("$column1", $column1, $body);
$body = str_replace("$column2", $column2, $body);
nuSendEmail(...);