Hi,
I have a custom hook like this:
<?php
$datestamp = date('Y-m-d H:i:s');
$hook->setValue('datestamp', $datestamp);
$ebat = $hook->getValue('UD2');
$ebat = (int)$ebat;
....
....
code with some calculate stuff
....
....
$hook->setValue('ergebnisM3', $e3);
$hook->setValue('ergebnisM4', $e4);
return true;
The part with the date stamp thing is copied from the MODx manuel.
In the e-Mail chunk I placed this:
....
....
E1: [[+ergebnisM3]]
E2: [[+ergebnisM4]]
Date: [[+datestamp]]
But, when I get the mail with the content. Alle the fields that are set in the hook via setValue are displayed as
[[+ergebnisM3]]
[+ergebnisM4]]
[[+datestamp]]
and not with the values. The other values that comes direct from the form are OK.
I tested the execute of my custom hook like they told me in the manuel:
<?php
$modx->log(xPDO::LOG_LEVEL_ERROR,'Testing my custom hook.');
return true; //<-- if you omit this or return false, your form won't validate
The hook is executing.
What can it be?
[ed. note: ichris89 last edited this post 8 years, 5 months ago.]