Giter VIP home page Giter VIP logo

strangerstudios / pmpro-constant-contact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from greathmaster/pmpro-constant-contact

3.0 2.0 10.0 85 KB

Integrate User Registrations with Constant Contact. Adds members to lists based on their membership level.

Home Page: https://www.paidmembershipspro.com/add-ons/pmpro-constant-contact/

PHP 100.00%
wordpress-plugin paid-memberships-pro constant-contact wordpress strangerstudios-product

pmpro-constant-contact's Introduction

=== Paid Memberships Pro - Constant Contact Add On ===
Contributors: strangerstudios
Tags: pmpro, paid memberships pro, constant contact, email marketing
Requires at least: 3.4
Tested up to: 5.4.1
Stable tag: 1.0.3

Add users and members to Constant Contact lists based on their membership level.

== Description ==

Note: This plugin was developed to support an older version of the third-party API and will not work with the latest version of Constant Contact. We are keeping it here for archive reasons and in case future development occurs. If you would like to add a vote to have this worked on, please use our [contact form](https://www.paidmembershipspro.com/contact/). As an alternative, you can consider using the [Zapier Integration](https://www.paidmembershipspro.com/add-ons/pmpro-zapier/).

Subscribe WordPress users and members to your Constant Contact lists.

This plugin offers extended functionality for [membership websites using the Paid Memberships Pro plugin](https://wordpress.org/plugins/paid-memberships-pro/) available for free in the WordPress plugin repository. 

With Paid Memberships Pro installed, you can specify unique lists for each membership level. By default, the integration will merge the user's first and last name if captured. You can send additional user profile details to Constant Contact [using the pmpro_constant_contact_custom_fields filter hook](https://www.paidmembershipspro.com/add-ons/pmpro-constant-contact/#hooks).

The settings page allows the site admin to specify which lists to assign users and members to, plus additional features you may wish to adjust.

= Additional Settings =

* **All Users List:** These are the lists that users will be added to if they do not have a membership level.
* **Unsubscribe on Level Change?:** If set to “No”, users will not be automatically unsubscribed from any lists when they lose a membership level. If set to “Just those managed by PMPro Constant Contact”, users will be unsubscribed from any level lists they are subscribed to when they lose that level, assuming that list is not a All Users list as well. If set to “All”, users will also be unsubscribed from all lists except the All Users List.

= Official Paid Memberships Pro Add On =

This is an official Add On for [Paid Memberships Pro](https://www.paidmembershipspro.com), the most complete member management and membership subscriptions plugin for WordPress.

== Installation ==
This plugin works with and without Paid Memberships Pro installed.

= Download, Install and Activate! =
1. Upload the `pmpro-constant-contact` directory to the `/wp-content/plugins/` directory of your site.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Navigate to Settings > PMPro Constant Contact to proceed with setup.

= Configuration and Settings =

**Enter your Constant Contact API Key and Access Token:** Your Constant Contact API Key and Access Token can be found within your Constant Contact account.

After entering these values, save the settings. You will know that your site is connected to your Constant Contact account when the lists appear on the settings page. Continue with the setup by assigning User or Member Lists and reviewing the additional settings.

For full documentation on all settings, please visit the [Constant Contact Integration Add On documentation page at Paid Memberships Pro](https://www.paidmembershipspro.com/add-ons/pmpro-constant-contact/). 

== Frequently Asked Questions ==

= I found a bug in the plugin. =

Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/strangerstudios/pmpro-constant-contact/issues

= I need help installing, configuring, or customizing the plugin. =

Please visit our premium support site at http://www.paidmembershipspro.com for more documentation and our support forums.

== Screenshots ==

1. General settings for all members/subscribers list and unsubscribe rules.
2. Membership-level specific list subscription settings.

== Changelog ==

= 1.0.3 =
* Updating Constant Contact Signup Link and new signups offer.

= 1.0.2 =
* Overhaul by Michael Roufa.
* Added options to only unsub from PMPro-related lists. (Thanks, Michael Roufa)
* Fixed bug where updates on the profile page led to members being added to all CC lists. (Thanks, Michael Roufa)

= 1.0.1 =
* Fixed warnings when PMPro is not also installed.

= 1.0 =
* Released to the WordPress repository.

= .1.1 =
* Showing API errors on settings page.

pmpro-constant-contact's People

Contributors

femiyb avatar greathmaster avatar ideadude avatar kimcoleman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pmpro-constant-contact's Issues

Fatal Error - Updating Member Roles

Whenever I was updating old members, assigning them a role and expiration date I received this error:

Uncaught exception 'Ctct\Exceptions\CtctException' with message '[{"error_key":"json.max.items.violation","error_message":"#/email_addresses: 2 items were contained, but the maximum number of items allowed is 1."}]' in /httpdocs/wp-content/plugins/pmpro-constant-contact/includes/Ctct/Util/RestClient.php:93

Stack Trace

#0 /httpdocs/wp-content/plugins/pmpro-constant-contact/includes/Ctct/Util/RestClient.php(48): Ctct\Util\RestClient::httpRequest('https://api.con...', 'PUT', Array, '{"id":"10634417...')

#1 /httpdocs/wp-content/plugins/pmpro-constant-contact/includes/Ctct/Services/ContactService.php(122): Ctct\Util\RestClient->put('https://api.con...', Array, '{"id":"10634417...')

#2 /httpdocs/wp-content/plugins/pmpro-constant-contact/includes/Ctct/ConstantContact.php(218): Ctct\Services\ContactService->updateContact('06847912-d102-4...', Object(Ctct\Components\Contacts\Contact), Array)

#3 /var

File - Line 93

/httpdocs/wp-content/plugins/pmpro-constant-contact/includes/Ctct/Util/RestClient.php

This could be unrelated but the reason I was doing the above was because some members were listed as "Old Members" or Expired even though the expiration date was listed was "January 2016". I changed the role, expiration date and check Send Email To This User.

WordPress database error You have an error in your SQL syntax

Hello,

I am trying to Run PMPro Constant Contact on my workers sites and getting thousands of errors a day saying 'WordPress database error You have an error in your SQL syntax'. They pretty much all are the same type of errors, but connecting to many different errors on my site, very odd. It seems my API key is correct and it is connecting to constant contact because the plug-in populates all of my contact lists, but nothing will sync into constant contact. Any idea what could be the issue!

Thanks in advance!

James

There has been a critical error on your website

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 5.3
Current theme: Astra (version 1.8.7)
Current plugin: Paid Memberships Pro - Constant Contact Add On (version 1.0.2)
PHP version 7.2.24

Error Details

An error of type E_ERROR was caused in line 622 of the file /srv/htdocs/wp-content/plugins/pmpro-constant-contact/pmpro-constant-contact.php. Error message: Uncaught Error: Call to undefined method Ctct\ConstantContact::getLists() in /srv/htdocs/wp-content/plugins/pmpro-constant-contact/pmpro-constant-contact.php:622
Stack trace:
#0 /wordpress/core/5.3/wp-includes/class-wp-hook.php(288): pmprocc_options_page('')
#1 /wordpress/core/5.3/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)
#2 /wordpress/core/5.3/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /wordpress/core/5.3/wp-admin/admin.php(254): do_action('settings_page_p...')
#4 /wordpress/core/5.3/wp-admin/options-general.php(10): require_once('/wordpress/core...')
#5 {main}
thrown

Plugin could not be activated because it triggered a fatal error.

When I go to activate my plug in i get this error:

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/content/61/8437461/html/CMCFabs/wp-content/plugins/pmpro-constant-contact/pmpro-constant-contact.php on line 15

method getContactByEmail undefined

In version 1.0.3 (also in 1.0.2), I'm seeing this error anytime a new member attempts to register:

PHP Fatal error: Call to undefined method Ctct\ConstantContact::getContactByEmail() in /var/www/html/wp-content/plugins/pmpro-constant-contact/pmpro-constant-contact.php on line 98, referer: http://example.com/membership-account/membership-checkout/?level=1

The code in pmpro-constant-contact.php looks like it should work, so I don't understand why the method is not defined:

91                 //get CC API object
92                 $api = new ConstantContact($options['api_key']);
93
94                 //subscribe them
95                 try
96                 {
97                         // check to see if a contact with the email addess already exists in the account
98                         $response = $api->getContactByEmail($options['access_token'], $list_user->user_email);

I do see the method defined under includes/Ctct/ConstantContact.php:

135     /**
136      * Get contacts with a specified email address
137      * @param string $accessToken - Constant Contact OAuth2 access token
138      * @param string $email - contact email address to search for
139      * @return array
140      */
141     public function getContactByEmail($accessToken, $email)
142     {
143         return $this->contactService->getContacts($accessToken, array('email' => $email));
144     }

Changing the initialization of $api from:

92                 $api = new ConstantContact($options['api_key']);

to

92                 $api = new \Ctct\ConstantContact($options['api_key']);

did not seem to help. Please let me know if this is a code bug or a configuration issue. Thanks!

API Key

Is there any reason that an API Key can't be included in this integration, rather than having your users generate their own API Keys, which is confusing for non-developers?

PLEASE, if possible, create a Mashery API Key by following the steps here (http://developer.constantcontact.com/api-keys.html) and include it in the project to make your integration more user friendly.

Thanks! Feel free to email any questions to [email protected], or have us approve a partner API Key for you if you decide to create a partner (and not just a standard) API Key in Mashery, and reference this post.

namespace for classes overlaps with other constant contact classes

On our site we have a constant contact plugin to handle sign up forms as well as integration with Paid Membership Pro. Recent updates have caused problems because Ctct/ConstantContact.php is an overlapping class namepsace. I updated the classes to pmproCtct and it resolved any classpath issues. Recommend the plugin properly namespace to ensure there is no overlap.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.