Skip to content

Commit

Permalink
Update form id
Browse files Browse the repository at this point in the history
  • Loading branch information
arnas committed Feb 9, 2024
1 parent 7d94eac commit 74d8139
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions omnisend-for-contact-form-7/module/class-wpcf7-omnisend.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function on_wpcf7_before_send_mail( $contact_form ) {

/** @var $contact_form WPCF7_ContactForm */
$form_id = $contact_form->id();
$form_name = $contact_form->name();

$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();
Expand Down Expand Up @@ -123,14 +122,14 @@ public function on_wpcf7_before_send_mail( $contact_form ) {

$email_consent = $form_meta_data->get_email_consent_field_name();
if ( ! empty( $posted_data[ $email_consent ] ) && $email_consent !== '---' ) {
$contact->set_email_consent( 'plugin (contact form 7), form name(' . $form_name . ')' );
$contact->set_email_opt_in( 'plugin (contact form 7), form name(' . $form_name . ')' );
$contact->set_email_consent( 'plugin (contact form 7), form id (' . $form_id . ')' );
$contact->set_email_opt_in( 'plugin (contact form 7), form id (' . $form_id . ')' );
}

$phone_consent = $form_meta_data->get_phone_consent_field_name();
if ( ! empty( $posted_data[ $phone_consent ] ) && $phone_consent !== '---' ) {
$contact->set_phone_consent( 'plugin (contact form 7), form name(' . $form_name . ')' );
$contact->set_phone_opt_in( 'plugin (contact form 7), form name(' . $form_name . ')' );
$contact->set_phone_consent( 'plugin (contact form 7), form id (' . $form_id . ')' );
$contact->set_phone_opt_in( 'plugin (contact form 7), form id (' . $form_id . ')' );
}

$form_tags = $contact_form->scan_form_tags();
Expand Down

0 comments on commit 74d8139

Please sign in to comment.