Skip to content

Instantly share code, notes, and snippets.

@matdave
Created June 8, 2018 18:07
Show Gist options
  • Save matdave/3ea352c399b7fed488cc534cc32ed6a4 to your computer and use it in GitHub Desktop.
Save matdave/3ea352c399b7fed488cc534cc32ed6a4 to your computer and use it in GitHub Desktop.
MODX FormIt Multi-Email Fix (for dynamic emails)
<?php
$fields = $hook->getValues();
$emailTo = $hook->formit->config['emailTo'];
if(strpos($emailTo,'[[+') !== false){
$emailVar = str_replace('[[+','',$emailTo);
$emailVar = str_replace(']]','',$emailVar);
$hook->formit->config['emailTo'] = $fields[$emailVar];
}
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment