Title: Patch for flamingo module
Last modified: August 21, 2016

---

# Patch for flamingo module

 *  [l.tamburo](https://wordpress.org/support/users/ltamburo/)
 * (@ltamburo)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/patch-for-flamingo-module/)
 * I make a patch into modules/flamingo.php
    with this patch cf7 send to flamingo“
   Mail subject” and “Mail from” if this field is set into cf7 form.
 * For example:
    **“Mail from” cf7 form** [your-fistname] [your-surname] [your-email]**“
   Flamingo from”** value_of_your-firstname value_of_your-surname **“Mail subject”
   cf7 form** [field-subject] **“Flamingo subject”** value_of_field-subject
 * or
 * **“Mail from” cf7 form**
    [your-fistname] [your-lastname] [your-email] **“Flamingo
   from”** value_of_your-firstname value_of_your-lastname **“Mail subject” cf7 form**
   My site example.com [field-subject] **“Flamingo subject”** My site example.com
   value_of_field-subject
 * I test patch against:
    WordPress ver. 3.6, Contact Form 7 ver. 3.5.2 and Flamingo
   ver. 1.0.4 all work fine for me.
 * change lines (modules/flamingo.php) 45 and 46:
 *     ```
       $name = isset( $posted_data['your-name'] ) ? trim( $posted_data['your-name'] ) : '';
       $subject = isset( $posted_data['your-subject'] ) ? trim( $posted_data['your-subject'] ) : '';
       ```
   
 * with this:
 *     ```
       /* check for mail subject */
       	if( isset( $contactform->mail['subject'] ) and !empty( $contactform->mail['subject'] ) )
       		$mail_subject_data = $contactform->mail['subject'];
       	else
       		$mail_subject_data = null;
   
       	if( ( $mail_subject_data != null ) and ( strlen( trim( $mail_subject_data ) ) > 0 ) ){
       		preg_match_all( "/\[(\S*?)]/", $mail_subject_data, $mail_subject_out, PREG_PATTERN_ORDER );
       		if( isset( $mail_subject_out[1] ) and !empty( $mail_subject_out[1] ) ){
       			foreach( $mail_subject_out[1] as $key ){
       				$mail_subject_data = str_replace( "[".$key."]", $posted_data[$key], $mail_subject_data );
       			}
       			$subject = trim( $mail_subject_data );
       		}else{
       			$subject = isset( $mail_subject_data ) ? trim( $mail_subject_data ) : '';
       		}
       	}else{
       		$subject = isset( $posted_data['your-subject'] ) ? trim( $posted_data['your-subject'] ) : '';
       	}
       	/* end check for mail subject */
       	/* check for mail sender */
       	if( isset( $contactform->mail['sender'] ) and !empty( $contactform->mail['sender'] ) )
       		$mail_sender_data = $contactform->mail['sender'];
       	else
       		$mail_sender_data = null;
   
       	if( ( $mail_sender_data != null ) and ( strlen( trim( $mail_sender_data ) ) > 0 ) ){
       		preg_match_all( "/\[(\S*?)]/", $mail_sender_data, $mail_sender_out, PREG_PATTERN_ORDER );
       		if( isset( $mail_sender_out[1] ) and !empty( $mail_sender_out[1] ) ){
       			foreach( $mail_sender_out[1] as $key ){
       				$mail_sender_data = ( $key == 'your-email' ) ? str_replace( "[your-email]", '', $mail_sender_data ) : str_replace( "[".$key."]", $posted_data[$key], $mail_sender_data );
       			}
       			$name = trim( $mail_sender_data );
       		}else{
       			$name = isset( $mail_sender_data ) ? trim( $mail_sender_data ) : '';
       		}
       	}else{
       		$name = isset( $posted_data['your-name'] ) ? trim( $posted_data['your-name'] ) : '';
       	}
       	/* end check for mail sender */
       ```
   
 * [http://wordpress.org/plugins/contact-form-7/](http://wordpress.org/plugins/contact-form-7/)

The topic ‘Patch for flamingo module’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [subject](https://wordpress.org/support/topic-tag/subject/)

 * 0 replies
 * 1 participant
 * Last reply from: [l.tamburo](https://wordpress.org/support/users/ltamburo/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/patch-for-flamingo-module/)
 * Status: not resolved