Skip to content

Instantly share code, notes, and snippets.

@mkay
Created January 18, 2014 10:08
Show Gist options
  • Save mkay/8488470 to your computer and use it in GitHub Desktop.
Save mkay/8488470 to your computer and use it in GitHub Desktop.
MODX FormIt custom hook example.
<?php
// Type: Snippet
$recipient = $hook->getValue('reason');
if($recipient == 'one'){
$email = '';
}
elseif($recipient == 'two'){
$email = '';
}
else{
$email = '';
}
$hook->setValues(array(
'sendTo' => $email
));
return true;
//?>
[[!FormIt?
&hooks=`recipient,email`
&emailTpl=`enquireemail`
&emailTo=`[[+sendTo]]`
&emailSubject=`Test Form`
&submitVar=`testsubmit`
]]
<select name="reason">
<option value="one">One</option>
<option value="two">Two</option>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment