Newline for each checked Checkbox in email instead of comma separated values
-
Hey all,
if you want to have a new line for each checked Checkbox in your sent email(!) instead of comma separated values follow these steps:
1. locate your wordpress plugin – contact-form-7 folder
( default: /wp-content/plugins/contact-form-7 )
2. go to the subdirectory “includes”
3. backup “classes.php” file
4. edit “classes.php” file and search for “function mail_callback”
(in version 3.3.3 it should be at line 570)
– If you just want to have the mod and don’t want to know what I’ve modified, skip 5 and 6 and continue with step 7. For advanced users go through 5 and 6 and skip 7
5. at line 579:
you can see how arrays are processed (as comma seperated values)
$replaced = join( ', ', $submitted );
6. you may change the part after the opening bracket to this
(for new lines): “\r\n” (please use double quotes here!)
so the whole line looks like:
$replaced = join( "\r\n", $submitted );
7. replace the whole function with these lines: pastebin.com
You can see the original line commented out.
PLEASE NOTE:
– I have not tested this with other form elements yet, but it should work.
– This affects all emailsI hope I could help and it works for you. ??
- The topic ‘Newline for each checked Checkbox in email instead of comma separated values’ is closed to new replies.