Hi! Thanks for using our plugin and sorry for the late answer.
We filter the compose method from WPCF7_Mail with “wpcf7_mail_components”. It’s used by WPCF7_Mail::send() and it is used by WPCF7_Submission->mail().
So we can filter the value before and after this to recreate the old template.
It’s not beautiful and I was not able to test but it’s a solution using filters and should work.
<?php
add_filter( 'wpcf7_mail_components', 'joxixi_wpcf7_mail_components_before_cf7het', 9, 3 );
add_filter( 'wpcf7_mail_components', 'joxixi_wpcf7_mail_components_after_cf7het', 99, 3 );
function joxixi_wpcf7_mail_components_before_cf7het( $components, $contactform, $wpcf7_mail ) {
if ( $wpcf7_mail->name() != 'mail_2' ) {
return $components;
}
$components['body_old'] = $components['body'];
return $components;
}
function joxixi_wpcf7_mail_components_after_cf7het( $components, $contactform, $wpcf7_mail ) {
if ( empty( $components['body_old'] ) ) {
return $components;
}
$components['body'] = $components['body_old'];
unset( $components['body_old'] );
return $components;
}
You can put this code in your functions.php
or in a new plugin.
Please backup before try.