You are here

README.txt in Mailchimp 7.4

Synchronize Drupal entities with Mailchimp lists and allow anyone with access to
edit entities (such as Users editing their own data) to subscribe, unsubscribe,
and update membership information. This module requires the
[Entity module](http://www.drupal.org/project/entity).

## Installation

1. Enable the Mailchimp Lists module, the Field UI module, and the Entity Module

2. To use Mailchimp Lists module, you will need to install and enable the Entity
API module [http://drupal.org/project/entity]([http://drupal.org/project/entity)

3. If you haven't done so already, add a list in your Mailchimp account. Follow
these directions provided by Mailchimp on how to
[add or import a list](http://kb.mailchimp.com/article/how-do-i-create-and-import-my-list).

## Usage
* Subscription Field
Create an entity type with an email address field, or pick an entity that has an
email address property (like Users). Add a field to the entity type of the type
"Mailchimp Subscription" and use the field UI to configure your Subcription
field.

* Merge Fields
You will see Merge Field options based on the configuration of your list through
Mailchimp. You can match these fields up to fields on your entity to push your
entity field values back to Mailchimp during subscriptions. 

## Field-level Settings

* Require subscribers to Double Opt-in
New subscribers will be sent a link with an email from Mailchimp that they must
follow to confirm their subscription, rather than being immediately subscribed
and send a confirmation message from Mailchimp.

## Rules (and Roles)
There is a single Rules action to subscribe or unsubscribe Entities with a
configured Mailchimp Subscription field. This can be used to simply re-create
the Roles-based auto-subscription functionality in earlier versions of Mailchimp
Lists. Simply create a Mailchimp Subscription field on Users and hide the field
from them in the UI, then create a rule that subscribes users to this list when
they are saved, based on their role.

A sample Rules configuration export is provided here. This assigns based on Role
"3" and targets a field called field_members:

{ "rules_member_subscriptions" : {
    "LABEL" : "Member Subscriptions",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "mailchimp_lists" ],
    "ON" : { "user_presave" : [] },
    "IF" : [
      { "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "3" : "3" } } } }
    ],
    "DO" : [
      { "mailchimp_lists_user_subscribe" : {
          "entity" : [ "account" ],
          "field" : [ "account:field-subscribers" ],
          "subscribe" : 1
        }
      }
    ]
  }
}

## Webhooks

Direct your browser to: admin/config/services/mailchimp 
You will now see a "Lists" tab. (admin/config/services/mailchimp/lists)
This should show you your lists, and allow you to control Webhook settings for
each list.

What does this mean?
When a user unsubscribes from a list or updates their profile through Mailchimp
rather than Drupal, Mailchimp will trigger an event to update the user's cached
Mailchimp member information. This will not update any of their merge field
data, or any other Entity data: it just changes the cached information. This
cached data means Drupal doesn't have to contact Mailchimp every time it wants
to gather subscription data.

In other words, this should be enabled if possible. Otherwise, you may be using
innaccurate information in Drupal. It is also important to note that the webhook
doesn't just clear cached data, but actually updates the cached data.

*Note: You cannot test webhooks if developing locally, as the Mailchimp system
can't reach your local computer unless you enable a tunneling service like
ngrok.*

File

modules/mailchimp_lists/README.txt
View source
  1. Synchronize Drupal entities with Mailchimp lists and allow anyone with access to
  2. edit entities (such as Users editing their own data) to subscribe, unsubscribe,
  3. and update membership information. This module requires the
  4. [Entity module](http://www.drupal.org/project/entity).
  5. ## Installation
  6. 1. Enable the Mailchimp Lists module, the Field UI module, and the Entity Module
  7. 2. To use Mailchimp Lists module, you will need to install and enable the Entity
  8. API module [http://drupal.org/project/entity]([http://drupal.org/project/entity)
  9. 3. If you haven't done so already, add a list in your Mailchimp account. Follow
  10. these directions provided by Mailchimp on how to
  11. [add or import a list](http://kb.mailchimp.com/article/how-do-i-create-and-import-my-list).
  12. ## Usage
  13. * Subscription Field
  14. Create an entity type with an email address field, or pick an entity that has an
  15. email address property (like Users). Add a field to the entity type of the type
  16. "Mailchimp Subscription" and use the field UI to configure your Subcription
  17. field.
  18. * Merge Fields
  19. You will see Merge Field options based on the configuration of your list through
  20. Mailchimp. You can match these fields up to fields on your entity to push your
  21. entity field values back to Mailchimp during subscriptions.
  22. ## Field-level Settings
  23. * Require subscribers to Double Opt-in
  24. New subscribers will be sent a link with an email from Mailchimp that they must
  25. follow to confirm their subscription, rather than being immediately subscribed
  26. and send a confirmation message from Mailchimp.
  27. ## Rules (and Roles)
  28. There is a single Rules action to subscribe or unsubscribe Entities with a
  29. configured Mailchimp Subscription field. This can be used to simply re-create
  30. the Roles-based auto-subscription functionality in earlier versions of Mailchimp
  31. Lists. Simply create a Mailchimp Subscription field on Users and hide the field
  32. from them in the UI, then create a rule that subscribes users to this list when
  33. they are saved, based on their role.
  34. A sample Rules configuration export is provided here. This assigns based on Role
  35. "3" and targets a field called field_members:
  36. { "rules_member_subscriptions" : {
  37. "LABEL" : "Member Subscriptions",
  38. "PLUGIN" : "reaction rule",
  39. "OWNER" : "rules",
  40. "REQUIRES" : [ "rules", "mailchimp_lists" ],
  41. "ON" : { "user_presave" : [] },
  42. "IF" : [
  43. { "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "3" : "3" } } } }
  44. ],
  45. "DO" : [
  46. { "mailchimp_lists_user_subscribe" : {
  47. "entity" : [ "account" ],
  48. "field" : [ "account:field-subscribers" ],
  49. "subscribe" : 1
  50. }
  51. }
  52. ]
  53. }
  54. }
  55. ## Webhooks
  56. Direct your browser to: admin/config/services/mailchimp
  57. You will now see a "Lists" tab. (admin/config/services/mailchimp/lists)
  58. This should show you your lists, and allow you to control Webhook settings for
  59. each list.
  60. What does this mean?
  61. When a user unsubscribes from a list or updates their profile through Mailchimp
  62. rather than Drupal, Mailchimp will trigger an event to update the user's cached
  63. Mailchimp member information. This will not update any of their merge field
  64. data, or any other Entity data: it just changes the cached information. This
  65. cached data means Drupal doesn't have to contact Mailchimp every time it wants
  66. to gather subscription data.
  67. In other words, this should be enabled if possible. Otherwise, you may be using
  68. innaccurate information in Drupal. It is also important to note that the webhook
  69. doesn't just clear cached data, but actually updates the cached data.
  70. *Note: You cannot test webhooks if developing locally, as the Mailchimp system
  71. can't reach your local computer unless you enable a tunneling service like
  72. ngrok.*