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.
Add subscribers to EmailOctopus via your WordPress Contact Form
<?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);
}
@finalwebsites
Copy link
Author

Use this action hook together with our contact form plugin and the plugin for EmailOctopus.
https://wordpress.org/plugins/fws-ajax-contact-form/
https://wordpress.org/plugins/fw-integration-for-emailoctopus/
Find more information on our website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment