Support » Plugin: Contact Form 7 » Changes to wpcf7_special_mail_tag?

  • Resolved bkolbay

    (@bkolbay)


    I have a particular appointment request form on my site that services a number of physical locations, each represented by an instance of my custom post type. When the form is submitted, a wpcf7_before_send_mail action grabs the post ID with wpcf7_special_mail_tag(”, ‘_post_id’, ”) to pull recipients defined in that instance and updates the recipients list.

    Or, at least, it did. A few weeks ago, we noticed the recipients weren’t getting updated and have found that our wpcf7_special_mail_tag call now just returns an empty string (or, more accurately, the value of the first parameter, if we define one).

    I also noticed reference to a new WPCF7_MailTag, but I’m struggling to find any related documentation and don’t know if it’s relevant to my issue.

    Any insight or suggestions for a better way to get that value in wpcf7_before_send_mail?

Viewing 1 replies (of 1 total)
  • Thread Starter bkolbay

    (@bkolbay)

    In case anyone stumbles onto this thread in the future, this is the code I’m now using to get the Post ID:

    
    $submission = WPCF7_Submission::get_instance();
    if($submission) {
    	$cf_url = $submission->get_meta( 'url' );
    	$postID = url_to_postid( $cf_url );
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Changes to wpcf7_special_mail_tag?’ is closed to new replies.