We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27672
    • 168 Posts
    trying to do a call like this:
    [!fillerSnippet!]
    [!eForm? &to=`[+somevalue+]` &formid=`ShareForm` &tpl=`ShareFormTpl` &report=`ShareReportTpl` &thankyou=`ShareThankyouTpl`!]

    where the content of "fillerSnippet" is something like:
    <?php
    $modx->setPlaceholder('somevalue', '[email protected]'); //will eventually populate from a database query
    return;
    ?>

    i can output the "somevalue" placeholder like:
    <p>To: [+somevalue+]</p>

    but it does not get passed into the eform code for processing. any idea what i’m doing wrong? i’ve got my page set as cacheable and the snippet calls are non-cacheable, but i swear i’ve tried every combination of things. do i need to use the "onBefore___" functions with eForm? am i using the setPlaceholder function improperly? it’s one of those problems i’ve been too wrapped up in to see clearly.
      • 4310
      • 2,310 Posts
      Snippet call :
      [[fillerSnippet]]
      [!eForm? eformOnBeforeMailSent=`getEmail` &formid=`ShareForm` &tpl=`ShareFormTpl` &report=`ShareReportTpl` &thankyou=`ShareThankyouTpl`!]

      "fillerSnippet" code :
      <?php
      function getEmail(&$fields)
      {
      $result = $modx->db->query('some database query...'); 
      $fields['to']= $result;
      return true;
      }
      ?>

      Untested with the "to" field but works with extra fields.