Created
July 15, 2025 18:37
-
-
Save finalwebsites/d39ab6d8be84504e45719a45527c6e9a to your computer and use it in GitHub Desktop.
Add subscribers to EmailOctopus via your WordPress Contact Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.