We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25441
    • 60 Posts
    Hi,

    i’ve try to use eFormOnMailSent, but unsuccessfully.

    snippet name: show_link
    <?php
    function test(){
    echo 'test';
    }
    ?>

    [[show_link]]
    [!eForm? &formid=`form1` &to=`[email protected]` &from=`[email protected]` &tpl=`feedback_tpl` &eFormOnMailSent=`test` &report=`formreport` &subject=`filled form` &protectSubmit=`0` !]


    After filling the form, i saw message : Fatal error: Call to undefined function test() in /home/ghttpdocs/assets/snippets/eform/eform.inc.php on line 519
      • 36416
      • 589 Posts
      Quote from: rolph at Mar 04, 2010, 04:35 AM

      i’ve try to use eFormOnMailSent, but unsuccessfully.

      Event handling functions have predefined set of parameters, and communicate with
      callers by changing those parameter referenced variables and returning values:
      function mailSent(&$fields) {
        $fields['return_calc']= "Sent!";
        return true;
      }	
      
        • 10487 MODX Staff
        • 1,535 Posts
        Also, make sure you call your custom function snippet uncached:
        [!show_link!]
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com