Hi,
I also have an issue regarding the WPCF7_ContactForm object – i am trying to edit the final email that gets sent by contact form 7.
If I run some simple code in functions.php (below) – it runs fine if I dont connect the form to Stripe BUT if I connect it then I cant find an easy way to edit the final email.
Do you have any ideas on how to do this as I want to simply add some basic code to modify the email before it gets sent, based on if they have paid. I specifically want the form ID and stripe transaction id if possible.
thanks
Matt.
add_action( ‘wpcf7_before_send_mail’, ‘wpcf7_add_text_to_mail_body’, 10, 3 );
function wpcf7_add_text_to_mail_body( $contact_form, $abort, $submission ) {
//Get the form ID & Mail ojbect
$form_id = $contact_form->id();`
$mail = $contact_form->prop( ‘mail’ ); // returns array