Posted by nodecode on February 6, 2013 at 7:17am
3 followers
| Project: | MailChimp |
| Version: | 7.x-2.x-dev |
| Component: | General |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
| Issue tags: | rules integration |
Issue Summary
I am happy to see that this module now supports limited Rules integration, however the subscription action Subscribe user to a mailchimp list cannot be used for interacting with anonymous visitors. The action will only accept a numeric UserID so it cannot use an email address, for example, that was submitted by an anonymous user through a Webform or as part of a product purchase in an e-commerce setting. See the power of this?
I actually wrote a patch for this and realized that someone else had written a nearly identical patch in #1593224: provide rules integration for 7.x-2.x so I'm re-uploading that user's patch since they did it first.
Anyway, I've tested the patch and it works great.
| Attachment | Size |
|---|---|
| mailchimp_lists_mail_subscribe_list.patch | 1.77 KB |
Comments
#1
This has to be a joke. At the exact same time you were doing this, I was [uh.. re-]writing the same patch! Except mine allows for an array of Mergevars to be manually included and hence I think is better. :-D
But it's practically identical!
Though, I don't think the $EMAIL mergevar is a requirement, per your patch.
#2
That's really too funny. I was actually going to suggest including $mergevars but I figured it would over-complicate things and didn't see a way it could be implemented yet. The $EMAIL mergevar in the patch I uploaded only appears to be necessary if there are no other fields for the merge, otherwise i don't know; perhaps the function would accept $mergevars as an empty array? I didn't try that.
Anyway, I tested your patch and it works just fine for basic subscription, however I cannot test the Mailchimp Merge Variables since I can't find a way to supply the rule with mailchimp_mergevars type data. Can you elaborate on your use case and how you're writing the data selection string?
P.S. I feel like line 77 of the patched file could be written as
'merge_variables' => array(instead of'mergevars' => array(for consistency with the associated function.#3
I can confirm that the $EMAIL mergevar in the patch I posted is necessary for Mailchimp to successfully report to the watchdog at admin/reports/dblog. Otherwise there is no indication of who was subscribed to the list. Your patch does not report properly since it does not include this.
#4
Since there has been no response regarding the more complex patch in comment #1, I'm changing the issue status for the purpose of committing the ORIGINAL PATCH. Again this patch was not created by me; it came from #1593224: provide rules integration for 7.x-2.x and since I've verified that it works, I think it should be committed.
@Offlein: Perhaps you can create a separate issue to further the work on your more complex patch to support merge variables.
#5
hopefully a change of status will prompt the attention of an admin to commit this
#6
related issue #1808704: Ability to put a Member into a MailChimp Group with a Rule Action
It allows you to put a subscriber in a MailChimp Group with a Rules action.
I think it currently subscribes the user to the list if the user not yet on the list that the group belongs to.