Email to (eval): access data

Status
Not open for further replies.

georgie

Member
Hello

In a Email plugin for a form, in the field "Email to (eval), I can not access the data submitted...
Sorry, I came from Fabrik3 :)

I tried a lot of things, for example:

PHP:
$origData = $formModel->getOrigData();
$test = $origData[0]->fb_message___theme;

var_dump($test);
exit;
PHP:
$origData = $formModel->getOrigData();
$test = $origData->fb_message___theme;

var_dump($test);
exit;
PHP:
$test = $this->data['messages___theme_raw'];
$test = is_array($test) ? $test[0] : $test;

var_dump($test);
exit;
PHP:
$test = $this->data['messages___theme_raw'];
$test = is_array($test) ? $test : $test;

var_dump($test);
exit;
PHP:
$test = $formModel->formData['messages___theme_raw'] ;

var_dump($test);
exit;

But always this kind of error:
Warning: Undefined array key "messages___theme_raw" in /home/clients/3ed8566f18b57c2f07041f9d7852d719/sites/j4binv.master-geomatique.org/libraries/fabrik/fabrik/fabrik/Helpers/Php.php(69) : eval()'d code on line 7
NULL

Please have you an idea? Is it a bug or I just miss something?

THX!
 
ok, found it.
Please change line 240 in plugins\fabrik_form\email\email.php
to
'thisVars' => ['data' => $this->data]]);

Then the F3 $this->data['something'] should do again.

$origData:
Should do. Did you test on a new record? (origData is empty in this case).
 
Right, your change works!

Now the F3 "$this->data['something']" (that I used with F3 indeed) works with F4!
What about the change "thisVars"? You will include it in the current Gamma2 or the next Gamma3?

$origData:
Should do. Did you test on a new record? (origData is empty in this case).

Yes indeed, new record! OK understood.

Thank you Troester!
 
Last edited:
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top