views:

1493

answers:

2

I don't know how much information you need for this, but WP-ContactForm-7 is a contact form for WordPress. By default it has one server response message for all forms on the website. I have multiple forms and would like a different server response messages for each one.

function message($status) {
 switch ($status) {
  case 'mail_sent_ok':
   return __('Your message was sent successfully. Thanks.', 'wpcf7');
  case 'mail_sent_ng':
   return __('Failed to send your message. Please try later or contact administrator by other way.', 'wpcf7');
  case 'validation_error':
   return __('Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7');
        case 'accept_terms':
            return __('Please accept the terms to proceed.', 'wpcf7');
  case 'invalid_email':
   return __('Email address seems invalid.', 'wpcf7');
  case 'invalid_required':
   return __('Please fill the required field.', 'wpcf7');
  case 'captcha_not_match':
   return __('Your entered code is incorrect.', 'wpcf7');
 }
}

If this is not enough info then you can download the file from here and look at the whole source code.

+2  A: 

You haven't asked a question. It seems as if you want us to code a solution for you. Free labor is not what this site is about. If you state a specific problem you are having with trying to implement this, or ask as question, then you will get a lot more help.

+1  A: 

If you make sure you've upgraded to the latest version of this plugin, you can create multiple forms, each with their own response messages.

To create a new form, go to Tools -> Contact Form 7 and click "Add new" (up the top in red).

Fill out your new form details, then go to 'Messages' and click 'show'. Here you can fill out the responses specific to this form. Once you're done, scroll up again and click the 'Save' button on the right.

You can then include a link to this other form in your posts by using something like:

[contact-form 2 "My second form"]

(The actual code to use will be shown on the page used to edit the form.)

miknight