Search code examples
wordpresscontact-form-7

Contact Form 7 - Selectable recipients with pipes not sending correct values


I have a problem when using selectable recipients with pipes in Contact Form 7 (CF7).

Code

[group loc1]
[md-select label="department"][select* dept-loc1 include_blank
"Machine 1|testperson1@test.com"
"Machine 2|testperson2@test.com"
"Machine 3|testperson3@test.com"
"Machine 4|testperson1@test.com"
[/md-select]
[/group]

[group loc2]
[md-select label="department"][select* dept-loc2 include_blank
"Machine 5|testperson3@test.com"
"Machine 6|testperson1@test.com"
"Machine 7|testperson3@test.com"
[/md-select]
[/group]

The md-select tag is for the Material Design plugin.

If I select "Machine 4" in Location/Group 1, an email will be sent to "testperson1@test.com" but with content "Machine 1" instead of "Machine 4". In Location/Group 2 it is the same problem. If I select "Machine 7", an email will be sent to "testperson3@test.com" with content "Machine 5" instead of "Machine 7".

Does anyone know how to fix this?


Solution

  • Use email aliases to overcome this issue, try this instead:

    [group loc1]
    [md-select label="department"][select* dept-loc1 include_blank
    "Machine 1|testperson1@test.com"
    "Machine 2|testperson2@test.com"
    "Machine 3|testperson3@test.com"
    "Machine 4|testperson1+4@test.com"
    [/md-select]
    [/group]
    
    [group loc2]
    [md-select label="department"][select* dept-loc2 include_blank
    "Machine 5|testperson3@test.com"
    "Machine 6|testperson1@test.com"
    "Machine 7|testperson3+7@test.com"
    [/md-select]
    [/group]
    

    I know the + addition works on gmail, I haven't tried with other emails. If it does not work with your email domain server, then you will need to create email aliases for those email addresses you want to use multiple times within your field, one alias for each extra use.