Beispiel #1
0
 public static function fulfill_order(&$entry, $transaction_id, $amount)
 {
     $config = self::get_config_by_entry($entry);
     if (!$config) {
         self::log_error("Order can't be fulfilled because feed wasn't found for form: {$entry["form_id"]}");
         return;
     }
     $form = RGFormsModel::get_form_meta($entry["form_id"]);
     if ($config["meta"]["delay_post"]) {
         self::log_debug("Creating post.");
         RGFormsModel::create_post($form, $entry);
     }
     if (isset($config["meta"]["delay_notifications"])) {
         //sending delayed notifications
         GFCommon::send_notifications($config["meta"]["selected_notifications"], $form, $entry, true, "form_submission");
     } else {
         //sending notifications using the legacy structure
         if ($config["meta"]["delay_notification"]) {
             self::log_debug("Sending admin notification.");
             GFCommon::send_admin_notification($form, $entry);
         }
         if ($config["meta"]["delay_autoresponder"]) {
             self::log_debug("Sending user notification.");
             GFCommon::send_user_notification($form, $entry);
         }
     }
     self::log_debug("Before gform_paypal_fulfillment.");
     do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
 }
 public static function send_emails($form, $lead)
 {
     $disable_user_notification = apply_filters("gform_disable_user_notification_{$form["id"]}", apply_filters("gform_disable_user_notification", false, $form, $lead), $form, $lead);
     if (!$disable_user_notification) {
         GFCommon::send_user_notification($form, $lead);
     }
     $disable_admin_notification = apply_filters("gform_disable_admin_notification_{$form["id"]}", apply_filters("gform_disable_admin_notification", false, $form, $lead), $form, $lead);
     if (!$disable_admin_notification) {
         GFCommon::send_admin_notification($form, $lead);
     }
 }
Beispiel #3
0
 public static function fulfill_order(&$entry, $transaction_id, $amount)
 {
     $form = RGFormsModel::get_form_meta($entry["form_id"]);
     $config = self::get_config($entry["form_id"]);
     if ($config && $config["meta"]["delay_post"]) {
         self::$log->LogDebug("Creating post.");
         RGFormsModel::create_post($form, $entry);
     }
     if ($config && $config["meta"]["delay_notification"]) {
         self::$log->LogDebug("Sending admin notification.");
         GFCommon::send_admin_notification($form, $entry);
     }
     if ($config && $config["meta"]["delay_autoresponder"]) {
         self::$log->LogDebug("Sending user notification.");
         GFCommon::send_user_notification($form, $entry);
     }
     self::$log->LogDebug("Before gform_paypal_fulfillment.");
     do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
 }
 public static function resend_notifications()
 {
     check_admin_referer('gf_resend_notifications', 'gf_resend_notifications');
     $leads = rgpost('leadIds');
     // may be a single ID or an array of IDs
     $leads = !is_array($leads) ? array($leads) : $leads;
     $form = RGFormsModel::get_form_meta(rgpost('formId'));
     if (empty($leads) || empty($form)) {
         _e("There was an error while resending the notifications.", "gravityforms");
         die;
     }
     $send_admin = rgpost('sendAdmin');
     $send_user = rgpost('sendUser');
     $override_options = array();
     $validation_errors = array();
     if (rgpost('sendTo')) {
         if (rgpost('sendTo') && GFCommon::is_invalid_or_empty_email(rgpost('sendTo'))) {
             $validation_errors[] = __("The <strong>Send To</strong> email address provided is not valid.", "gravityforms");
         }
         if (!empty($validation_errors)) {
             echo count($validation_errors) > 1 ? '<ul><li>' . implode('</li><li>', $validation_errors) . '</li></ul>' : $validation_errors[0];
             die;
         }
         $override_options['to'] = rgpost('sendTo');
         $override_options['bcc'] = '';
         // overwrite bcc settings
     }
     foreach ($leads as $lead_id) {
         $lead = RGFormsModel::get_lead($lead_id);
         if ($send_admin) {
             GFCommon::send_admin_notification($form, $lead, $override_options);
         }
         if ($send_user) {
             GFCommon::send_user_notification($form, $lead, $override_options);
         }
     }
     die;
 }
Beispiel #5
0
 /**
  * Fulfill order
  *
  * @param array $entry
  */
 public function fulfill_order($entry)
 {
     $feed = get_pronamic_gf_pay_feed_by_entry_id(rgar($entry, 'id'));
     if (null !== $feed) {
         $this->maybe_update_user_role($entry, $feed);
         $form = RGFormsModel::get_form_meta($entry['form_id']);
         // Delay post creation
         // @see https://github.com/gravityforms/gravityforms/blob/1.8.20.5/forms_model.php#L2383
         // @see https://github.com/gravityforms/gravityformspaypal/blob/1.10.3/paypal.php#L2411-L2415
         if ($feed->delay_post_creation) {
             RGFormsModel::create_post($form, $entry);
         }
         // Delay Aweber
         // @see https://github.com/gravityforms/gravityformsaweber/blob/1.4.2/aweber.php#L1167-L1197
         if ($feed->delay_aweber_subscription && Pronamic_WP_Pay_Class::method_exists('GFAWeber', 'export')) {
             call_user_func(array('GFAWeber', 'export'), $entry, $form, false);
             // @since 1.3.0
             // @see https://github.com/gravityforms/gravityformsaweber/blob/2.2.1/aweber.php#L48-L50
             // @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
             if (function_exists('gf_aweber')) {
                 $addon = gf_aweber();
                 if (method_exists($addon, 'maybe_process_feed')) {
                     $addon->maybe_process_feed($entry, $form);
                 }
             }
         }
         // Delay Campaign Monitor
         if ($feed->delay_campaignmonitor_subscription) {
             // @see https://github.com/gravityforms/gravityformscampaignmonitor/blob/2.5.1/campaignmonitor.php#L1184
             if (Pronamic_WP_Pay_Class::method_exists('GFCampaignMonitor', 'export')) {
                 call_user_func(array('GFCampaignMonitor', 'export'), $entry, $form, false);
             }
             // @since 1.3.0
             // @see https://github.com/gravityforms/gravityformscampaignmonitor/blob/3.3.2/campaignmonitor.php#L48-L50
             // @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
             if (function_exists('gf_campaignmonitor')) {
                 $addon = gf_campaignmonitor();
                 if (method_exists($addon, 'maybe_process_feed')) {
                     $addon->maybe_process_feed($entry, $form);
                 }
             }
         }
         // Delay Mailchimp
         if ($feed->delay_mailchimp_subscription) {
             // @see https://github.com/gravityforms/gravityformsmailchimp/blob/2.4.5/mailchimp.php#L1512
             if (Pronamic_WP_Pay_Class::method_exists('GFMailChimp', 'export')) {
                 call_user_func(array('GFMailChimp', 'export'), $entry, $form, false);
             }
             // @since 1.3.0
             // @see https://github.com/gravityforms/gravityformsmailchimp/blob/3.6.3/mailchimp.php#L48-L50
             // @see https://github.com/gravityforms/gravityforms/blob/1.9.10.15/includes/addon/class-gf-feed-addon.php#L43
             if (function_exists('gf_mailchimp')) {
                 $addon = gf_mailchimp();
                 if (method_exists($addon, 'maybe_process_feed')) {
                     $addon->maybe_process_feed($entry, $form);
                 }
             }
         }
         // Delay Zapier
         // @see https://github.com/gravityforms/gravityformszapier/blob/1.4.2/zapier.php#L469-L533
         if ($feed->delay_zapier && Pronamic_WP_Pay_Class::method_exists('GFZapier', 'send_form_data_to_zapier')) {
             call_user_func(array('GFZapier', 'send_form_data_to_zapier'), $entry, $form);
         }
         // Delay user registration
         // @see https://github.com/gravityforms/gravityformsuserregistration/blob/2.0/userregistration.php#L2133
         if ($feed->delay_user_registration && Pronamic_WP_Pay_Class::method_exists('GFUser', 'gf_create_user')) {
             call_user_func(array('GFUser', 'gf_create_user'), $entry, $form, false);
         }
         // Delay notifications
         // Determine if the feed has Gravity Form 1.7 Feed IDs
         if ($feed->has_delayed_notifications()) {
             // @see https://bitbucket.org/Pronamic/gravityforms/src/42773f75ad7ad9ac9c31ce149510ff825e4aa01f/common.php?at=1.7.8#cl-1512
             GFCommon::send_notifications($feed->delay_notification_ids, $form, $entry, true, 'form_submission');
         }
         if ($feed->delay_admin_notification && Pronamic_WP_Pay_Class::method_exists('GFCommon', 'send_admin_notification')) {
             // https://github.com/gravityforms/gravityforms/blob/1.8.9/common.php#L1265-L1270
             GFCommon::send_admin_notification($form, $entry);
         }
         if ($feed->delay_user_notification && Pronamic_WP_Pay_Class::method_exists('GFCommon', 'send_user_notification')) {
             // https://github.com/gravityforms/gravityforms/blob/1.8.9/common.php#L1258-L1263
             GFCommon::send_user_notification($form, $entry);
         }
     }
     // The Gravity Forms PayPal Add-On executes the 'gform_paypal_fulfillment' action
     do_action('gform_ideal_fulfillment', $entry, $feed);
 }
 public static function fulfill_order(&$entry, $transaction_id, $amount)
 {
     $form = RGFormsModel::get_form_meta($entry["form_id"]);
     $config = self::get_config($entry["form_id"]);
     if ($config && $config["meta"]["delay_post"]) {
         RGFormsModel::create_post($form, $entry);
     }
     if ($config && $config["meta"]["delay_notification"]) {
         GFCommon::send_admin_notification($form, $entry);
     }
     if ($config && $config["meta"]["delay_autoresponder"]) {
         GFCommon::send_user_notification($form, $entry);
     }
     do_action("gform_paypal_fulfillment", $entry, $config, $transaction_id, $amount);
 }
 public static function fulfill_order($entry, $transaction_id, $initial_payment_amount, $subscription_amount)
 {
     $form = RGFormsModel::get_form_meta($entry["form_id"]);
     $config = self::get_config_by_entry($entry["id"]);
     if ($config) {
         self::log_debug("Creating post.");
         RGFormsModel::create_post($form, $entry);
         self::log_debug("Post created.");
         self::log_debug("Sending admin notification.");
         GFCommon::send_admin_notification($form, $entry);
         self::log_debug("Sending user notification.");
         GFCommon::send_user_notification($form, $entry);
     }
     do_action("gform_paypalpro_fulfillment", $entry, $config, $transaction_id, $initial_payment_amount, $subscription_amount);
 }