=== Maileon for WordPress ===
Contributors: Marcus Ständer
Tags: xqueue, xq, maileon, email, marketing, newsletter, subscribe, subscription, integration
Requires at least: 4.2
Tested up to: 4.6
Stable tag: 1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Subscribe contacts with your Maileon account as newsletter recipients.

== Description ==

#### Maileon for WordPress

This plugin helps you to set up forms for subscribing contacts with your mailing lists in Maileon. It is fully configurable and provides a simple form, a sidebar widget, and the possibility to build more complex forms e.g. with Contact Forms 7.

#### Some features

- Configuring your wordpress to connect with your Maileon account using the admin GUI
- Use shortcodes to include a form whereever you want


== Installation ==

#### Installing the plugin
1. In your WordPress admin panel, go to *Plugins > New Plugin*, search for **Maileon for WordPress** and click "*Install now*"
2. Alternatively, download the plugin and upload the contents of 'maileon-for-wp.zip' to your plugins directory, which usually is '/wp-content/plugins/'.
3. Activate the plugin
4. Set your API key under Settings -> Maileon.

#### Configuring Standard Sign-Up Form(s)
You can add a standard form using the shortcode [maileon-contact].
The standard formular provides input fields for the email address, first name and last name. Aditionally you can add a set of fixed standard-/custom-fields, e.g. if you want to submit the german locale for every contact (fixed), you have to provide a JSON object with key-value pairs, where the key is the field name.
For standard fields use the attribute name "standard", for custom fields "custom". The keys for standardfields can be founc here: http://dev.maileon.com/api/rest-api-1-0/contacts/standard-contact-fields. Be careful to use correct capitalization, also for your custom fields. They must match exactly to the variable names you provided in Maileon.
Example: [maileon-contact standard="{'LOCALE':'de_DE'"]

#### Configuring Sidebar Widget(s)
The sidebar widget can be added and customized like any other widget. It provides a single registration form. The title and submit button text can be changed in the widget settings and it uses the confirmation messages from the general plugin settings.

#### Integration With Other Form Plugins
The form can also be connected with other form plugins, here an example for Contact Forms 7.
The basic approach is to edit the Plugin-File in wordpress, like prepared for CF7:
// ------------------------------ CF7 ------------------------------
// Catch possible hook for CF7
add_action( 'wpcf7_mail_sent', 'your_wpcf7_mail_sent_function' );
function your_wpcf7_mail_sent_function( $contact_form ) {
	$contact_form->skip_mail = true;
	$title = $contact_form->title();
	$submission = WPCF7_Submission::get_instance();
	$formData= $submission->get_posted_data();
	$result = XQ_Maileon::register_contact( null, $formData);
	return true;
}
// ------------------------------ End CF7 ------------------------------
This piece of code catches the submission of the form and registers the contact with Maileon.
When using the addon CF7 Modules (https://wordpress.org/plugins/contact-form-7-modules/) for hidden fields, you can also pass configuration parameters in the form. The following are valid and documented at: http://dev.maileon.com/api/rest-api-1-0/contacts/create-contact/
[hidden doi "true"]
[hidden doiplus "true"]
[hidden doimailing ""]
[hidden permission "1"]
[hidden sync_mode "2"]

== Frequently Asked Questions ==
None yet.

== Screenshots ==
None yet.

== Upgrade Notice ==
None yet.

== Changelog ==

= 1.0 =
31.08.2016
Initial version