-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Option to Subscribe to Blog via MailChimp List #114
Comments
Referencing an existing integration with the MailChimp API that was done in s2Member: It uses the MailChimp PHP SDK for v2 of the MailChimp API: |
Added a Feature Wishlist above. ↑ |
@kristineds I'm assigning this to you, and I'll try to work with you a little bit at a time in order to make some progress on this. I'm going break this down into small phases and explain what needs to happen along the way--as time allows. I'll start with the MailChimp API and explain that we need to add a new submodule to the pro repo as a way to prepare for work that needs to occur in the near future. This is something that you can go ahead and get started on now if you like :-) Adding the Submodule (Next Steps)Note: MailChimp integration will be available in the pro version only at this time. Start Feature Branch$ cd ~/projects/websharks/comment-mail-pro
$ git checkout 000000-dev # Start from the dev branch.
$ git pull # Make sure you're working from an up-to-date copy w/ all of the latest changes.
$ git checkout -b feature/114 # A new feature branch for this issue. Update Submodules$ cd ~/projects/websharks/comment-mail-pro
$ git submodule init # Initialize submodules, just in case you haven't done this already. If you've already done it, doing it again won't hurt anything.
$ git submodule update # Make sure all Git submodules are up-to-date. Add New Submodule$ cd ~/projects/websharks/comment-mail-pro
$ git submodule add https://bitbucket.org/mailchimp/mailchimp-api-php comment-mail-pro/submodules/mailchimp Note: This brings the MailChimp PHP SDK into the Comment Mail source code as a Git submodule. This way it will be available to us as part of the Comment Mail distribution whenever we work on the next steps; i.e., whenever we implement calls to the MailChimp API. Commit and Push Changes$ cd ~/projects/websharks/comment-mail-pro
$ git status # Quick review. You should be on the feature/114 branch.
$ git add --all && git commit -m 'Adding MailChimp submodule; see websharks/comment-mail#114'
$ git push -u origin feature/114 Submit a Pull RequestPro version only, please submit a pull request. |
@jaswsinc Submitting Comment Mail Pro PR for Adding MailChimp submodule: #114 |
Adding MailChimp submodule; see wpsharks/comment-mail#114
@jaswsinc I assume this should not have been closed? |
@kristineds Keep in mind when submitting Pull Requests that if a particular PR doesn't actually close a GitHub Issue, i.e., it's just part of working towards closing a GitHub issue, then you don't want to use the word "Closes" inside the body of the Pull Request, otherwise when the PR gets merged, the associated GitHub issue will be automatically closed by GitHub. In this case, it would have been better to just write No worries, just something to keep in mind for future reference. I personally prefer to never use "Closes" in a GitHub Pull Request and instead manually close the associated GitHub issue when I know it's ready to be closed. That's better than accidentally closing it and forgetting that there was more work to be done on that issue. |
@raamdev Correct. Thanks for catching that. |
Next Actions (Step 2)New Feature Branch
Add Abstract Base Class for List Server Integrations
<?php
/**
* List Server Abstraction
*
* @since 15xxxx Adding support for mailing lists.
* @copyright WebSharks, Inc. <http://www.websharks-inc.com>
* @license GNU General Public License, version 3
*/
namespace comment_mail // Root namespace.
{
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));
if(!class_exists('\\'.__NAMESPACE__.'\\list_server_base'))
{
/**
* List Server Abstraction
*
* @since 15xxxx Adding support for mailing lists.
*/
abstract class list_server_base extends abs_base
{
/**
* Subscribe to list.
*
* @since 15xxxx Adding support for mailing lists.
*
* @param array $list An array with details that identify a particular list.
* @param array $args User ID, email address, IP, etc. Details needed by the list server.
*
* @return string Subscriber ID. If already exists on the list, the existing ID.
*/
abstract public function subscribe(array $list, array $args);
/**
* Unsubscribe from list.
*
* @since 15xxxx Adding support for mailing lists.
*
* @param array $list An array with details that identify a particular list.
* @param array $args User ID, email address, IP, etc. Details needed by the list server.
*
* @return boolean True if removed from the list. True if not on the list. False on failure.
*/
abstract public function unsubscribe(array $list, array $args);
}
}
} MailChimp Class (Extends Base)
<?php
/**
* MailChimp List Server
*
* @since 15xxxx Adding support for mailing lists.
* @copyright WebSharks, Inc. <http://www.websharks-inc.com>
* @license GNU General Public License, version 3
*/
namespace comment_mail // Root namespace.
{
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));
if(!class_exists('\\'.__NAMESPACE__.'\\list_server_mailchimp'))
{
/**
* MailChimp List Server
*
* @since 15xxxx Adding support for mailing lists.
*/
class list_server_mailchimp extends list_server_base
{
/**
* Subscribe to list.
*
* @since 15xxxx Adding support for mailing lists.
*
* @param array $list An array with details that identify a particular list.
* @param array $args User ID, email address, IP, etc. Details needed by the list server.
*
* @return string Subscriber ID. If already exists on the list, the existing ID.
*/
public function subscribe(array $list, array $args)
{
// Integration with MailChimp API.
}
/**
* Unsubscribe from list.
*
* @since 15xxxx Adding support for mailing lists.
*
* @param array $list An array with details that identify a particular list.
* @param array $args User ID, email address, IP, etc. Details needed by the list server.
*
* @return boolean True if removed from the list. True if not on the list. False on failure.
*/
public function unsubscribe(array $list, array $args)
{
// Integration with MailChimp API.
}
}
}
} Submit Pull Request |
Next Actions (Step 3)New Feature Branch
MailChimp Config. Option KeysPro VersionAfter this line add a new section: # Related to list server integrations.
'list_server_enable' => '0', // `0|1`; enable?
'list_server' => 'mailchimp', // List server identifier.
'list_server_mailchimp_api_key' => '', // MailChimp API key.
'list_server_mailchimp_list_id' => '', // MailChimp list ID. Lite Version (Awareness)After this line in the lite version, we need to make Comment Mail aware that this functionality will be possible once you upgrade. These keys help with our Pro Preview functionality. Add the following keys after this line: # Related to list server integrations.
'list_server_enable',
'list_server',
'list_server_mailchimp_api_key',
'list_server_mailchimp_list_id', Submit Pull Request |
Next Actions (Step 4)New Feature Branch
List Server Utilities Class
<?php
/**
* List Server Utilities
*
* @since 15xxxx Adding list server integrations.
* @copyright WebSharks, Inc. <http://www.websharks-inc.com>
* @license GNU General Public License, version 3
*/
namespace comment_mail // Root namespace.
{
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));
if(!class_exists('\\'.__NAMESPACE__.'\\utils_list_server'))
{
/**
* List Server Utilities
*
* @since 15xxxx Adding list server integrations.
*/
class utils_list_server extends abs_base
{
// @TODO Process subscribe and unsubscribe actions.
}
}
} Property Annotation for IDEsAfter this line add a new line for these utilities. * @property-read utils_list_server $utils_list_server Submit Pull Request |
What's on deck after these?
|
@raamdev @renzms Fixed in the dev branch by wpsharks/comment-mail-pro@d47f012 @renzms Thanks for catching that! 💯 |
Next Release Changelog:
|
@renzms Can you fetch the |
@raamdev @jaswsinc Tested the latest I can confirm there is no longer a PHP error. 👍 I noticed this behavior though with the Subscription/Auto-Confirm Workflow in the following conditions, please let me know if this is the correct/expected behavior: Steps to Reproduce
Scenario 1: Unsubscribed Users cannot resubscribe:
Scenario 2: Admin can change integrated MailChimp List ID to circumvent cancelling subscriptions:
|
@renzms Thank you for catching this. I updated the i.e., Once you unsubscribe, MailChimp requires a double opt-in via email confirmation on your next attempt to subscribe. Not ideal, but that's the best I've been able to do for now. |
@renzms writes...
@jaswsinc writes...
|
Referencing debug output from tests of my own to reproduce the issue reported by Renz.
|
Noting that |
@renzms @raamdev I have been unable to find a way around this problem given limitations in v2 of the MailChimp API that I have been working with. Once a user unsubscribes, the MailChimp API refuses to add them again no matter what settings I use in the API call. I suggest that we release the MailChimp integration as-is (it works great otherwise) and then in the future we can take a closer look at this whenever we upgrade the MailChimp API version; i.e., we can see if there's a way to work around this in a new version of their API. I'm opening this new issue as a fork. See: #311 |
@jaswsinc Got it. I agree with moving forward as-is. We'll upgrade the MailChimp API as part of the next release. |
Got it! Thanks! |
- **Bug Fix:** Exclude unapproved comments from the dropdown menu on the 'Subscribe Without Commenting' form. See [Issue #299](#299). - **Enhancement:** When parsing templates, this release uses `include()` instead of `eval()` whenever possible. This improves compatibility with shared hosting providers and makes it easier to debug template parsing issues should they occur. See [Issue #192](#192). - **PHP v7 Compatibility:** After further testing, it was found that while Comment Mail is compatible with PHP v7.0, you must be running PHP v7.0.9+. Starting with this release of Comment Mail if you're running PHP v7 < 7.0.9 a warning is displayed in the WordPress Dashboard asking the site owner to upgrade to PHP v7.0.9 or higher. Note: While PHP v7.0.9 is adequate, PHP v7.0.10 is strongly recommended. See [Issue #272](#272). - **New SparkPost Integration** (Pro): It is now possible to use SparkPost for Replies-via-Email (RVE) instead of Mandrill. Note that SparkPost is now the suggested RVE Handler for Comment Mail because Mandrill changed its pricing structure a while back. In short, Mandrill requires a fee, whereas SparkPost (recommended) offers Relay Webhooks as a part of their free plan. See [Issue #265](#265). - **New Feature** (Pro): Adding support for MailChimp integration. It is now possible to give users the option of subscribing to your site-wide mailing list whenever they leave a comment or reply; i.e., in addition to subscribing to comment reply notifications they can also join your MailChimp mailing list. See [Issue #114](#114).
Comment Mail v161118 has been released and includes changes from this GitHub Issue. See the v161118 announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#114). |
It would be GREAT if Comment Mail included an option to allow a commenter to optionally subscribe to the blog via a specific MailChimp list at the same time that they leave a comment.
For example, the Jetpack Subscriptions module allows for this (except it uses WordPress.com to manage the subscriptions, not a MailChimp list):
Feature Wishlist
I'd love to see the following features related to this:
Forked from #113 (comment).
The text was updated successfully, but these errors were encountered: