3.0.0releasedMailChimp

Subscribe users to a MailChimp mailing list

Clone URLhttps://github.com/lewiswharf/mailchimp.git

Add as a submodulegit submodule add https://github.com/lewiswharf/mailchimp.git extensions/mailchimp --recursive

Compatibility

2.x.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.02.6.12.6.22.6.32.6.42.6.52.6.62.6.72.6.82.6.92.6.102.6.11
NoNo1.182.1.22.1.22.2.03.0.03.0.03.0.03.0.03.0.03.0.03.0.03.0.03.0.03.0.03.0.03.0.0

Readme

MailChimp

The MailChimp extension allows users to subscribe to a list and supports unlimited number of merge fields.

Install

  1. Upload the /mailchimp in this archive to your Symphony /extensions folder.
  2. Enable it by selecting the "MailChimp" item under Extensions, choose Enable from the with-selected menu, then click Apply.
  3. Go to Symphony's preferences and enter MailChimp API Key and List ID (optional).
  4. Attach the MailChimp event to the appropriate page.
  5. Create form and necessary XSLT. Any extra fields for the list defined in MailChimp must be declared in your form.
  6. Ajax (optional)
    1. Link javascript file /extensions/mailchimp/assets/subscribe.js
    2. Call plugin.

````js var completeCallback = function (data) { ... }; var errorCallback = function (data) { alert(data.error); }

$(function () { $('#the-form').mailchimp({ complete: completeCallback, error: errorCallback }) }); ````

Note: In the callbacks (error and complete) the context of the function (the "this" keyword) will be
set to #the-form. The "data" parameters contains all the values in the event XML as JSON.

Example

<xsl:choose>
    <xsl:when test="events/mailchimp[@result = 'success'] ">
        <h1>Thank You</h1>
        <p class="success">Check your e-mail to <strong>confirm your e-mail address</strong>.</p>
    </xsl:when>
    <xsl:otherwise>
        <h1>Newsletter</h1>
        <xsl:if test="events/mailchimp[@result = 'error'] ">
            <p class="error"><xsl:value-of select="events/mailchimp/error" /></p>
        </xsl:if>
        <form id="the-form" method="post" action="" enctype="multipart/form-data">
        <fieldset>
            <label>
                First Name <small>(required)</small>
                <input type="text" name="merge[FNAME]" value="{events/mailchimp/cookies/cookie[@handle = 'FNAME']}" />
            </label>
            <label>
                Last Name <small>(required)</small> 
                <input type="text" name="merge[LNAME]" value="{events/mailchimp/cookies/cookie[@handle = 'LNAME']}" />
            </label>
            <label>
                E-Mail Address <small>(required)</small>
                <input type="text" name="email" value="{events/mailchimp/cookies/cookie[@handle = 'email']}" />
            </label>
            <input type="hidden" name="list" value="{your-list-id}" />
            <input id="submit" type="submit" name="action[signup]" value="Sign me up" />
            </fieldset>
        </form>
    </xsl:otherwise>
</xsl:choose>

Notes

  • E-mail field must be lowercase as portrayed above.
  • Merge fields must have merge lowercase and match a Mailchimp field (i.e. merge[SOME_FIELD] whereby 'SOME_FIELD' must match exactly).
  • Merge fields must be passed in the form, but they can be hidden if desired.
  • To subscribe the user to multiple lists, simply add the list using commas (i.e. list-1,list-2,list-3).

Version history

Symphony 2.6.0 to 2.6.x

  • Updated MailChimp API to 3.0
  • Added check and custom error when email already in list
  • Changed subscription call to add email to list or update if already in list

Symphony 2.5.0 to 2.6.x

  • Fixed issue with namespace of Class 'Drewm\MailChimp' not found (again)
  • Updated submodule drewm/mailchimp-api to latest version
  • Added support to subscribe to multiple lists

Symphony 2.3 to 2.5.x

  • Fixed issue with email already subscribed API response
  • Fixed issue with namespace of Class 'Drewm\MailChimp' not found

Symphony 2.3 to 2.5.x

  • Fixed issue with renamed core method (saveConfig -> write)

Symphony 2.3 to 2.5.x

  • Updated submodule drewm/mailchimp-api to latest version
  • Added js snippet in the readme

Requires Symphony 2.3

  • Updated MailChimp API to 2.0
  • Allow overwriting of List ID (used as default)
  • Update of Event to return similar fields to Symphony events

Requires Symphony 2.3

  • Fixed Ajax issue (nitriques)

Requires Symphony 2.3

  • Added support for redirect on success.

Requires Symphony 2.3

Symphony 2.2 to 2.2.5

  • Fix a bug to handle & from MailChimp in error messages.
  • Fix a bug where $output could be mixed (Thanks nitriques).
  • A couple bug fixes including issue #3.
  • Ajax bug fix.
  • Ajax capability added (Thanks nitriques).
  • Switched from login/password to using the API key for authentication. MailChimp has deprecated the former. Clarified directions regarding merge fields.
  • Updated wrapper for API 1.3
  • Fixed bug to allow email address only form
  • Updated for Symphony 2.2 and increased flexibility to handle infinite merge fields.
  • Initial build