Skip to content

Instantly share code, notes, and snippets.

@degoya
Forked from mkay/recipient.php
Last active April 7, 2022 13:19
Show Gist options
  • Save degoya/92d7fa5f7f6c251b86db to your computer and use it in GitHub Desktop.
Save degoya/92d7fa5f7f6c251b86db 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