Search code examples
phpformscontact-form-7

How can I make Contact form 7 return the checkbox label and not the value data on mailing a form?


I have a Contact form 7 that the client insists goes to different mailboxes based on checkbox selection.

I can do this by:

[checkbox* your-recipient class:checks label_first use_label_element exclusive "Sales | [email protected]" "Rent| [email protected]"]

This works perfectly but on the mail form they want the subject to be the key and not the value?

Subject: Contact form enquiry - [your-recipient]

This returns either:

 Subject: Contact form enquiry - [email protected]
 Subject: Contact form enquiry - [email protected]

Is there a way to make the subject read:

 Subject: Contact form enquiry - Sales
 Subject: Contact form enquiry - Rent

Many Thanks


Solution

  • To get value before pipe, you use [raw{field name}] in your case :

    Subject: Contact form enquiry - [_raw_your-recipient]