On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Long story short, i need to parse the email fields in a form and based on user input, validate and send them.

    I’m building a "wishlist" email form where the intended recipients are those that are filled out in the "senders form" or form that the customer is filling out.

    Somehow I need to pass in the email addresses AFTER the form has submitted.

    Right now, instead of replacing these fields with real email addresses, it tries to send them to [+requestEmail2+], [+requestEmail3+], etc...

    How do I make it so it parses those variable holders so it actually sends to a real email address?

    controller...
    [[eForm?
    &subject=`Your friend sent you their wishlist!`
    &formid=`wishListSendersForm`
    &ccsender=`1`
    &to=`[+requestEmail1+]`
    &bcc=`[+requestEmail2+],[+requestEmail3+],[+requestEmail4+],[+requestEmail5+]`
    &autosender=`no-reply@domain.com`
    &tpl=`WISHLIST_sendersform`
    &report=`WISHLIST_recipients_receivers_form`
    &gotoid=`196`
    &sendAsHtml
    !]]

    tpl or "WISHLIST_sendersform" template: (Not the whole thing, just the pertinent part)

    <table><tr>
    <td><span class=’t10’><b>Name</b></span></td><td><span class=’t10’><b>Email</b></span></td>
    </tr><tr>
    <td><input type="text" name="requestName1" class="input" value=""></td>
    <td><input type="text" name="requestEmail1" class="input" value="" size="35"></td>
    </tr><tr>
    <td><input type="text" name="requestName2" class="input" value=""></td>
    <td><input type="text" name="requestEmail2" class="input" value="" size="35"></td>
    </tr><tr>
    <td><input type="text" name="requestName3" class="input" value=""></td>
    <td><input type="text" name="requestEmail3" class="input" value="" size="35"></td>
    </tr><tr>
    <td><input type="text" name="requestName4" class="input" value=""></td>
    <td><input type="text" name="requestEmail4" class="input" value="" size="35"></td>
    </tr><tr>
    <td><input type="text" name="requestName5" class="input" value=""></td>
    <td><input type="text" name="requestEmail5" class="input" value="" size="35"></td>
    </tr>
    </table>