Skip to content

Instantly share code, notes, and snippets.

View jonpasquier's full-sized avatar

Jonathan Pasquier jonpasquier

View GitHub Profile
@jonpasquier
jonpasquier / class-gfnewmailpoetaddon.php
Created October 1, 2018 08:30
Gravity Form MailPoet add-on with "deactivate Email validation" functionality
<?php
GFForms::include_feed_addon_framework();
class GFNEWMailPoetAddOn extends GFFeedAddOn {
protected $_version = GF_NEW_MAILPOET_ADDON_VERSION;
protected $_min_gravityforms_version = '1.9.16';
protected $_slug = 'add-on-gravity-forms-mailpoet';
protected $_path = 'add-on-gravity-forms-mailpoet/gravity-forms-mailpoet.php';
protected $_full_path = __FILE__;
/**
* Add subscriber info to the desired lists when submission is complete.
*/
public function process_feed( $feed, $entry, $form ) {
..............
try {
$subscriber_data = \MailPoet\API\API::MP( 'v1' )->addSubscriber( $subscriber_data, $mailpoetlists,