Skip to content

Commit

Permalink
Add a new code 'Email Marketing Services Integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wow-Company committed Oct 10, 2017
1 parent 18728ad commit f35e795
Show file tree
Hide file tree
Showing 102 changed files with 13,965 additions and 2 deletions.
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# emsi-for-wordpress
Easy Wordpress integration with email marketing services.
Email Marketing Services Integration for WordPress
======================

Description
----
Plugin Email Marketing Services Integration gives the opportunity to integrate your site on Wordpress with popular email marketing services. This plugin helps to add subscribers to the lists of e-mail services.

**Features:**
* integration with popular email marketing services;
* integration with plugins for collecting subscribers;
* subscription when registering and adding comments.

**Integration with the following plugins:**
* [Easy Digital Downloads](https://wordpress.org/plugins/easy-digital-downloads/)
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
* [Users Activity](https://wordpress.org/plugins/users-activity/)

**Integration with the following email marketing services:**
* [MailChimp](https://mailchimp.com/)
* [AWeber](https://www.aweber.com)
* [ActiveCampaign](https://www.activecampaign.com/)
* [SendinBlue](https://www.sendinblue.com/)
* [GetResponse](https://www.getresponse.com/)



Bugs
----
If you think you've found a bug, [please raise an issue here](https://github.com/dmytrolobov/emsi-for-wordpress/issues?state=open)!


Support
-------
Please visit the
[Email Marketing Services Integration for WordPress support forum on WordPress.org](https://wordpress.org/support/plugin/email-marketing-services-integration/).


Contributions
-------------
Anyone is welcome to contribute to the plugin. There are various ways you can contribute:

* [Raise an issue](https://github.com/dmytrolobov/emsi-for-wordpress/issues) on GitHub.
* Send us a Pull Request with your bug fixes and/or new features.
* Provide feedback and [suggestions on enhancements](https://github.com/dmytrolobov/emsi-for-wordpress/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
50 changes: 50 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
=== Email Marketing Services Integration ===
Contributors: Wpcalc, lobov
Donate link: https://wow-estore.com/
Tags: email integration, email services, email marketing, email subscribe, mailchimp, aweber, activecampaign, sendinblue, getresponse,
Requires at least: 4.5
Tested up to: 4.8
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Easy Wordpress integration with email marketing services.

== Description ==
Plugin Email Marketing Services Integration gives the opportunity to integrate your site on Wordpress with popular email marketing services. This plugin helps to add subscribers to the lists of e-mail services.

= Features: =
* integration with popular email marketing services;
* integration with plugins for collecting subscribers;
* subscription when registering and adding comments.

= Integration with the following plugins: =
* [Easy Digital Downloads](https://wordpress.org/plugins/easy-digital-downloads/)
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
* [Wow Forms](https://wordpress.org/plugins/mwp-forms/)
* [Users Activity](https://wordpress.org/plugins/users-activity/)

= Integration with the following email marketing services: =
* [MailChimp](https://mailchimp.com/)
* [AWeber](https://www.aweber.com)
* [ActiveCampaign](https://www.activecampaign.com/)
* [SendinBlue](https://www.sendinblue.com/)
* [GetResponse](https://www.getresponse.com/)

= To increase the number of subscribers and attract attention of users we recommend to use it together with such plugins: =
* [Modal Window – create a simple popup & insert any content](https://wordpress.org/plugins/modal-window/)
* [Countdowns – create any counter, timer and coundown](https://wordpress.org/plugins/mwp-countdown/)
* [Float menu – awesome floating side menu](https://wordpress.org/plugins/float-menu/)
* [Bubble Menu – awesome custom circle menu](https://wordpress.org/plugins/bubble-menu/)
* [Herd Effects – fake notifications to motivate users to take action](https://wordpress.org/plugins/mwp-herd-effect/)


== Screenshots ==
1. Integration
2. Email Services


== Changelog ==

= 1.0 =
* Initial release
136 changes: 136 additions & 0 deletions admin/class-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Admin Page Class
*
* @package WOW_EMS_Integration_ADMIN
* @subpackage
* @copyright Copyright (c) 2017, Dmytro Lobov
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/

class WOW_EMS_Integration_ADMIN {

private $arg;

public function __construct( $arg ) {
$this->plugin_name = $arg['plugin_name'];
$this->plugin_menu = $arg['plugin_menu'];
$this->version = $arg['version'];
$this->pref = $arg['pref'];
$this->slug = $arg['slug'];
$this->plugin_dir = $arg['plugin_dir'];
$this->plugin_url = $arg['plugin_url'];
$this->plugin_home_url = $arg['plugin_home_url'];
$this->shortcode = $arg['shortcode'];


// admin pages
add_action( 'admin_menu', array($this, 'add_menu_page') );
add_action( 'admin_init', array($this, 'update_option') );

}
function add_menu_page() {
add_submenu_page('wow-company', $this->plugin_name, $this->plugin_menu, 'manage_options', $this->slug, array( $this, 'plugin_admin' ));
}

function plugin_admin() {
global $wow_company_plugin;
$wow_company_plugin = true;
include_once( $this->plugin_dir.'admin/partials/index.php' );
self:: plugin_admin_style_script();
}
function plugin_admin_style_script() {
// plugin sctyle & script
wp_enqueue_style( $this->slug.'-style', $this->plugin_url . 'admin/css/style.css',false, $this->version);
wp_enqueue_style( $this->slug.'-icon', $this->plugin_url . 'asset/font-awesome/css/font-awesome.min.css', array(), '4.7.0' );
wp_enqueue_script($this->slug.'-script', $this->plugin_url . 'admin/js/script.js', array('jquery'), $this->version);
}

// Update an option
public function update_option(){
if ( !empty($_POST['wow_'.$this->pref.'_nonce_field']) && wp_verify_nonce($_POST['wow_'.$this->pref.'_nonce_field'],'wow_'.$this->pref.'_update') ){
$new_option = wp_unslash($_POST[''.$this->pref.'']);
$options = get_option( $this->pref );
if (empty($options)){
$result = $new_option;
}
else {
$result = array_merge($options, $new_option);
}
update_option( $this->pref, $result );
$reffer = $_POST['_wp_http_referer'];
$url = add_query_arg( array('ua-message' => 'update'), $reffer );
wp_redirect($url);
exit;
}
}

function create_option ($arg){
$id = isset($arg['id']) ? $arg['id'] : null;
$name = isset($arg['name']) ? $arg['name'] : '';
$type = isset($arg['type']) ? $arg['type'] : '';
$func = !empty($arg['func']) ? ' onchange="'.$arg['func'].'();"' : '';
$options = isset($arg['option']) ? $arg['option'] : '';
$val = $arg['val'];
$separator = isset($arg['sep']) ? $arg['sep'] : '';
// create radio fields
if ($type == 'radio'){
$option = '';
foreach ($options as $key => $value){
$select = ($key == $val) ? 'checked="checked"' : '';
$option .= '<input name="'.$this->pref.'['.$name.']" type="radio" value="'.$key.'" id="wow_'.$id.'_'.$key.'" '.$select.'><label for="wow_'.$id.'_'.$key.'"> '.$value.'</label>'.$separator;
}
$field = $option;
}

// create checkbox field
if ($type == 'checkbox'){
$select = !empty($val) ? 'checked="checked"' : '';
$field = '<input type="checkbox" '.$select.$func.' id="wow_'.$id.'">'.$separator;
}

// create text field
if ($type == 'text'){
$field = '<input name="'.$this->pref.'['.$name.']" type="text" value="'.$val.'" id="wow_'.$id.'"'.$func.'>'.$separator;
}

// create number field
if ($type == 'number'){
$field = '<input name="'.$this->pref.'['.$name.']" type="number" value="'.$val.'" id="wow_'.$id.'"'.$func.'>'.$separator;
}

// create color field
if ($type == 'color'){
$field = '<input name="'.$this->pref.'['.$name.']" type="text" value="'.$val.'" class="wp-color-picker-field" data-alpha="true">'.$separator;
}

// create select field
if ($type == 'select'){
$option = '';
foreach ($options as $key => $value){
$select = ($key == $val) ? 'selected="selected"' : '';
$option .= '<option value="'.$key.'" '.$select.'>'.$value.'</option>';
}
$field = '<select name="'.$this->pref.'['.$name.']"'.$func.' id="wow_'.$id.'">';
$field .= $option;
$field .= '</select>';
}

// create editor field
if ($type == 'editor'){
$settings = array(
'textarea_name' => ''.$this->pref.'['.$name.']',
);
$field = wp_editor( $val, $id, $settings );

}

// create textarea field
if ($type == 'textarea'){
$field = '<textarea name="'.$this->pref.'['.$name.']" id="wow_'.$id.'">'.$val.'</textarea>'.$separator;
}
return $field;
}

}
1 change: 1 addition & 0 deletions admin/css/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php // Silence is golden
Loading

0 comments on commit f35e795

Please sign in to comment.