private function formatInputForEmail($input, $form_data)
{
$module_builder = new Services\ModuleBuilder();
$form_fields = $module_builder->getFormFields($form_data);
$fields = array_combine($form_fields['fields'], $form_fields['field_names']);
foreach ($fields as $key => $value) {
// dd($key);
$input[$value] = $input[$key];
unset($input[$key]);
}
unset($input['_token']);
unset($input['form_id']);
if (isset($input['captcha'])) {
// Do not save the value of captcha to database
unset($input['captcha']);
}
return $input;
}