Skip to content
Advertisement

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@address1.co.uk" "Rent| email@address2.co.uk"]

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@address1.co.uk
 Subject: Contact form enquiry - email@address2.co.uk

Is there a way to make the subject read:

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

Many Thanks

Advertisement

Answer

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

Subject: Contact form enquiry - [_raw_your-recipient]
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement