WPBuddy / largo

A WordPress framework for news websites. Finely-crafted by INN and expertly-honed and maintained by the technology team at WP Buddy.
http://largo.wpbuddy.co
GNU General Public License v2.0
171 stars 83 forks source link

Standardize Mailchimp signup widget #1154

Open benlk opened 8 years ago

benlk commented 8 years ago

For Helpdesk-531 and part of #1038

aschweigert commented 8 years ago

Needed for http://jira.inn.org/browse/FE-175

benlk commented 8 years ago

Getting a form automatically from Mailchimp is not possible with their version 2 or version 3 API:

2: https://apidocs.mailchimp.com/api/2.0/#lists-methods 3: http://developer.mailchimp.com/documentation/mailchimp/reference/overview

Depending on the form created, the form may or may not have checkboxes or fields beyond "enter your email address" and the anti-bot field. The anti-bot input text field has a randomly-generated id, which needs to be POSTed on the form submit. If the form has checkboxes, the checkbox input elements have ids that are randomly generated. We can't predict those from the submit UR.

There are a couple of ways to make this work:

  1. paste your form url, Largo scrapes the form and cuts the form out of the Mailchimp website, removes unnecessary classes and then places it in the widget. This would require Largo to pack a web scraper and would be dependent upon Mailchimp not changing the layout of their form pages. Not a good idea.
  2. paste your submit url, your anti-bot field ID, any other form code, and so on into a widget that uses our HTML and CSS, but injects their additional form code into the widget. Probably a lot harder on the user than the next option:
  3. paste your generated form code, Largo includes it in a manner similar to a normal text widget but has some classes on the wrapping .widget that would allow Largo to ship default styles.
aschweigert commented 8 years ago

Option #2 + we recommend a "typical" form arrangement and give people instructions on how to set that up in MailChimp.

aschweigert commented 8 years ago

Also, you're way overthinking this. We are consistently using MailChimp forms on a number of sites. All I want to do is pave that cowpath so we're not replicating the same code across all of these sites.

aschweigert commented 8 years ago

The default should basically just be a form that has a box for an email address and a signup button. If people want to do something more custom then they'd be extending the widget with additional fields.

rclations commented 7 years ago

what's left on this?

benlk commented 7 years ago

https://github.com/INN/Largo/pull/1185 is the open PR; it needs to be updated with the latest develop and then needs review.