Maileon for WordPress | Marcus Beckerle | email

Maileon for WordPress | Marcus Beckerle | email,marketing

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 customizable templates for simple forms, a sidebar widget, and the possibility to build more complex forms e.g. with Contact Forms 7. Since version 2.6.0 it is possible to add AddressCheck for your form to prevent misspelled e-mail addresses.

Some features

  • Configuring your wordpress to connect with your Maileon account using the admin GUI
  • Use shortcodes to include a form whereever you want, different templates for different forms are possible
  • Multilingual support
  • AddressCheck support

Installation

Installing Requirements

Make sure cURL, SPL and SimpleXML for PHP are installed and enabled and that you are using PHP 5.6.x or higher.

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 Forms

Configuring Shorttags

You can add a standard form using the shortcode [maileon-contact].
To configure the behavior of the form, you can set the attributes from the REST-API documentation for each form. An example for a common shorttag: [maileon-contact doi=”true” doiplus=”true” sync_mode=1 ]

For more information about the shorttags, please refer to our documentation

Please note that by default already existing contacts are not updated to avoid customers overriding information. If you think that updates should be allowed, please pass parameter sync_mode=1.
Example: [maileon-contact sync_mode=1]

Configuring Forms

The plugin comes with a set of predefined forms for newsletter subscription and allows adding own custom forms. In addition, there is the possibiligy to add forms for profile updates, e.g. letting a contact add or edit details.

For handling forms, please refer to our documentation

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.

For more details how to use the sidebar widget, please refer to our documentation

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 add the following hook to your WordPress by using a plugin like Code Snippets (https://de.wordpress.org/plugins/code-snippets/)

// ------------------------------ CF7 ------------------------------
// Prevent CF7 from sending mails
add_action( 'wpcf7_before_send_mail', 'xq_wpcf7_before_send_mail' );

function xq_wpcf7_before_send_mail( $wpcf7_data ) {
    // Since version 4.0 the author changed $skip_mail to be private, use hook instead
    //$wpcf7_data->skip_mail = true;
    add_filter('wpcf7_skip_mail','xq_wpcf7_skip_mail');

    $submission = WPCF7_Submission::get_instance();
    $formData= $submission->get_posted_data();

    // If only a form with a certain ID should be submitted, provide the id here
    // This can be extended to use an array of IDs or even check if a hidden field is available in the posted data...
    if (in_array($wpcf7_data->id(), array(16, 31))) {
        $result = XQ_Maileon::register_contact($formData);

        // If there is an error set a message and add the error handler
        if (!$result['response']->isSuccess()) {
            global $message;
            $message = "Es ist ein Fehler aufgetreten: " . $result['response']->getBodyData();
            add_filter( 'wpcf7_ajax_json_echo', 'xq_wpcf7_ajax_json_echo', 10, 2 );
        }
    }
    return $wpcf7_data;
}

// Method to update the status message
function xq_wpcf7_ajax_json_echo($response, $result) {
    global $message;
    $response['mailSent'] = false;
    $response['status'] = 'mail_failed';
    $response['message'] = $message;
    return $response;
}

// New method to skip mails from CF7 itself
function xq_wpcf7_skip_mail($f){
    $submission = WPCF7_Submission::get_instance();
    return true;
}
// ------------------------------ End CF7 ------------------------------

This piece of code catches the submission of the form and checks if the ID of the form matches one of the provided elements, here 16 or 31. this check has been added to prevent all contact forms to submit data to Maileon, you can of course also remove this condition or check if a certain (hidden) post field is available. If the condition is fulfilled it registers the contact with Maileon. It also displays an error message in case of errors.
You can also pass configuration parameters in the form. The following are valid parameters 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 “1”]

Adding AddressCheck (ADC)

You can help users preventing entering misspelled e-mail addresses by enabling AddressCheck in the plugin settings. ADC will check the mailbox of the e-mail address entered in your form in order to decide if it really exists or not. To enable AddressCheck, just provide your API user and API key and check “Use ADC”. You can also select an ADC check delay in seconds to prevent the plugin from checking the given address too often and an ID of the e-mail form field. The plugin will display ADC results by setting classes ‘adc_status_icon_valid’, ‘adc_status_icon_warn’, or ‘adc_status_icon_invalid’ to the e-mail form field and making an element with ID ‘adc_error_message’ visible or invisible, depending if there is a problem or not. An example form with ADC can be found in template=’maileon-contact-form-adc-sample.php’

Plugin author

Marcus Beckerle

Plugin official website address

https://wordpress.org/plugins/xqueue-maileon/
If you encounter problems in using the Maileon for WordPress plugin, you can comment below, and I will try my best to help you solve the problem

Leave a Comment

Your email address will not be published. Required fields are marked *