Skip to content

Instantly share code, notes, and snippets.

@finalwebsites
Created July 15, 2025 18:37
Show Gist options
  • Select an option

  • Save finalwebsites/d39ab6d8be84504e45719a45527c6e9a to your computer and use it in GitHub Desktop.

Select an option

Save finalwebsites/d39ab6d8be84504e45719a45527c6e9a to your computer and use it in GitHub Desktop.

Revisions

  1. finalwebsites created this gist Jul 15, 2025.
    13 changes: 13 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <?php
    // add this code to your child theme
    add_action('fwsacf_after_success_form', 'fw_add_newsletter_contact_form');
    function fw_add_newsletter_contact_form($form_obj) {
    if (!class_exists('FWEO_EmailOctopus_integration')) return;
    $data = array('FirstName' => $form_obj['name']);
    if (!empty($form_obj['accept_terms'])) {
    $data['tags'] = 'newsletter';
    }
    $list = get_option('fweo_emailoctopus_list_id');
    $eo = new FWEO_EmailOctopus_integration();
    $eo->add_subscriber($form_obj['email'], $list, $data);
    }