2017 © Pedro Peláez
 

library wordpress-mailchimp-tools

Collection of tools for authoring MailChimp newsletters via the WordPress dashboard

image

inn/wordpress-mailchimp-tools

Collection of tools for authoring MailChimp newsletters via the WordPress dashboard

  • Thursday, January 19, 2017
  • by rnagle
  • Repository
  • 7 Watchers
  • 4 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

MailChimp Tools for WordPress

What is this?

This project aims to provide a simple set of tools for author MailChimp Campaigns via the WordPress post editor., (*1)

Right now, it provides:, (*2)

  • A settings panel to add/save your MailChimp API Key.
  • A campaign editor meta box.
  • A campaign preview meta box.
  • A settings panel for setting campaign defaults on a per-post-type basis.

Getting started

This tool set is not a plugin. You won't see it available in the WordPress dashboard for activation., (*3)

You must include the library in your plugin., (*4)

You can add the tools via Composer:, (*5)

composer require inn/wordpress-mailchimp-tools:dev-master

A simple example

require_once __DIR__ . '/vendor/autoload.php';

function my_plugin_init() {
    register_post_type('newsletter', array(
        'label' => 'Newsletter',
        'labels' => array(
            'name' => 'Newsletters',
            'singular_name' => 'Newsletter'
        ),
        'show_ui' => true,
        'public' => true
    ));

}
add_action( 'init', 'my_plugin_init' );

Templates

The campaign editor relies on an mc:edit="body" editable content area specified in whatever template you use., (*6)

When creating or updating a campaign, the tools will add the WordPress post's body to the element of your template that has the mc:edit="body" attribute., (*7)

A simple-one-column.html with the mc:edit="body" placemarker is included in the templates/ directory. You can copy the contents on simple-one-column.html and use MailChimp's template importer to add the template to your account., (*8)

Read more about MailChimp's templates here., (*9)

Set default content for your post type

You can use the default_content filter to load boilerplate markup into the post editor for your custom post type:, (*10)

function my_default_content($content) {
    $screen = $screen = get_current_screen();
    if ( $screen->post_type ==  'newsletter' ) {
        $default_content = file_get_contents( __DIR__ . '/templates/my-newsletter-default-markup.html' );
        return $default_content;
    }
    return $content;
}
add_filter( 'default_content', 'my_default_content' );

The Versions

19/01 2017

dev-master

9999999-dev https://nerds.inn.org/

Collection of tools for authoring MailChimp newsletters via the WordPress dashboard

  Sources   Download

GPL-2.0

The Requires

 

api email

29/01 2016

dev-benlk-readme-typofixes

dev-benlk-readme-typofixes https://nerds.inn.org/

Collection of tools for authoring MailChimp newsletters via the WordPress dashboard

  Sources   Download

GPL-2.0

The Requires

 

api email