-
-
Save degoya/92d7fa5f7f6c251b86db to your computer and use it in GitHub Desktop.
MODX FormIt custom hook example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Type: Snippet | |
$recipient = $hook->getValue('reason'); | |
if($recipient == 'one'){ | |
$email = ''; | |
} | |
elseif($recipient == 'two'){ | |
$email = ''; | |
} | |
else{ | |
$email = ''; | |
} | |
$hook->setValues(array( | |
'sendTo' => $email | |
)); | |
return true; | |
//?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[!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