Easy Forms for MailChimp - Version 6.0.4.2

Version Description

Download this release

Release Info

Developer eherman24
Plugin Icon 128x128 Easy Forms for MailChimp
Version 6.0.4.2
Comparing to
See all releases

Code changes from version 6.0.4.1 to 6.0.4.2

includes/class-yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -62,7 +62,7 @@ class Yikes_Inc_Easy_Mailchimp_Extender {
62
  */
63
  public function __construct() {
64
  $this->yikes_inc_easy_mailchimp_extender = 'yikes-inc-easy-mailchimp-extender';
65
- $this->version = '6.0.4.1';
66
  $this->load_dependencies();
67
  $this->define_admin_hooks();
68
  $this->define_public_hooks();
62
  */
63
  public function __construct() {
64
  $this->yikes_inc_easy_mailchimp_extender = 'yikes-inc-easy-mailchimp-extender';
65
+ $this->version = '6.0.4.2';
66
  $this->load_dependencies();
67
  $this->define_admin_hooks();
68
  $this->define_public_hooks();
public/js/yikes-update-existing-subscriber.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Trigger an email to be sent over to the user to update existing details
3
+ * - fires when the 'click here' link is clicked
4
+ * @since 6.0.4.1
5
+ */
6
+ jQuery( document ).ready( function() {
7
+ jQuery( 'body' ).on( 'click', '.send-update-email', function() {
8
+ /* Submit an ajax request to send off the update email */
9
+ var data = {
10
+ 'action': 'easy_forms_send_email',
11
+ 'user_email': jQuery( this ).attr( 'data-user-email' ),
12
+ 'list_id': jQuery( this ).attr( 'data-list-id' ),
13
+ };
14
+ jQuery( this ).parent( 'p' ).fadeTo( 'fast', .75 ).append( '<img src="' + update_subscriber_details_data.preloader_url + '" class="update-email-preloader" />' );
15
+ /* We can also pass the url value separately from ajaxurl for front end AJAX implementations */
16
+ jQuery.post( update_subscriber_details_data.ajax_url, data, function(response) {
17
+ if( response.success ) {
18
+ jQuery( '.yikes-easy-mc-error-message' ).removeClass( 'yikes-easy-mc-error-message' ).addClass( 'yikes-easy-mc-success-message' ).html( response.data.response_text );
19
+ } else {
20
+ jQuery( '.yikes-easy-mc-error-message' ).fadeTo( 'fast', 1 ).html( response.data.response_text );
21
+ }
22
+ });
23
+ return false;
24
+ });
25
+ });
public/partials/ajax/class.public_ajax.php CHANGED
@@ -103,13 +103,13 @@
103
  $subject = 'MailChimp Profile Update';
104
  $headers = 'From: ' . $list_details['data'][0]['default_from_name'] . ' <' . $list_details['data'][0]['default_from_email'] . '>' . "\r\n";
105
  $headers .= 'Content-type: text/html';
106
- $email_content = '<p>Dear user,</p> <p>A request has been made to update your account information. To do so use the following link: <a href="http://' . $explode_url[1] . '.' . $data_center . '.list-manage1.com/profile?u=' . $account_details['user_id'] . '&id=' . $list_id .'&e=' . $subscriber_id . '" title="Update MailChimp Profile">Update Profile Info.</a>';
107
- $email_content .= "<p>If you didn't request this update, please disregard this email.</p>";
108
  $email_content .= '<p>&nbsp;</p>';
109
  $email_content .= '<p>This email was sent from : ' . $full_site_url . '</p>';
110
  $email_content .= '<p>&nbsp;</p>';
111
  $email_content .= '<p>&nbsp;</p>';
112
- $email_content .= '<p style="font-size:13px;margin-top:5em;float:right;"><em>this email was generated by the <a href="http://www.wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">Easy Forms for MailChimp by YIKES</a> plugin, created by <a href="http://www.yikesinc.com" target="_blank">YIKES Inc.</a></em></p>';
113
  /* Confirm that the email was sent */
114
  if ( wp_mail( $user_email, apply_filters( 'yikes-mailchimp-update-email-subject', $subject ), apply_filters( 'yikes-mailchimp-update-email-content', $email_content ), $headers ) ) {
115
  wp_send_json_success(
103
  $subject = 'MailChimp Profile Update';
104
  $headers = 'From: ' . $list_details['data'][0]['default_from_name'] . ' <' . $list_details['data'][0]['default_from_email'] . '>' . "\r\n";
105
  $headers .= 'Content-type: text/html';
106
+ $email_content = '<p>Greetings,</p> <p>A request has been made to update your MailChimp account profile information. To do so please use the following link: <a href="http://' . $explode_url[1] . '.' . $data_center . '.list-manage1.com/profile?u=' . $account_details['user_id'] . '&id=' . $list_id .'&e=' . $subscriber_id . '" title="Update MailChimp Profile">Update MailChimp Profile Info.</a>';
107
+ $email_content .= "<p>If you did not request this update, please disregard this email.</p>";
108
  $email_content .= '<p>&nbsp;</p>';
109
  $email_content .= '<p>This email was sent from : ' . $full_site_url . '</p>';
110
  $email_content .= '<p>&nbsp;</p>';
111
  $email_content .= '<p>&nbsp;</p>';
112
+ $email_content .= '<p style="font-size:13px;margin-top:5em;"><em>This email was generated by the <a href="http://www.wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">Easy Forms for MailChimp</a> plugin, created by <a href="http://www.yikesinc.com" target="_blank">YIKES Inc.</a></em></p>';
113
  /* Confirm that the email was sent */
114
  if ( wp_mail( $user_email, apply_filters( 'yikes-mailchimp-update-email-subject', $subject ), apply_filters( 'yikes-mailchimp-update-email-content', $email_content ), $headers ) ) {
115
  wp_send_json_success(
public/partials/shortcodes/process/process_form_submission.php CHANGED
@@ -240,7 +240,7 @@ if ( ! isset( $_POST['yikes_easy_mc_new_subscriber'] ) || ! wp_verify_nonce( $_P
240
  $process_submission_response = '<p class="yikes-easy-mc-error-message">' . __( 'Please enter a valid email address.' , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
241
  }
242
  } else if ( strpos( $error_response, 'already subscribed' ) !== false ) { // user already subscribed
243
- $update_account_details_link = ( $form_settings['optin_settings']['update_existing_user'] == 1 ) ? apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( 'To update your profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click here', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click here', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ) : false;
244
  if( $update_account_details_link ) {
245
  // if update account details is set, we need to include our script to send out the update email
246
  wp_enqueue_script( 'update-existing-subscriber.js', YIKES_MC_URL . 'public/js/yikes-update-existing-subscriber.js' , array( 'jquery' ), 'all' );
240
  $process_submission_response = '<p class="yikes-easy-mc-error-message">' . __( 'Please enter a valid email address.' , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
241
  }
242
  } else if ( strpos( $error_response, 'already subscribed' ) !== false ) { // user already subscribed
243
+ $update_account_details_link = ( $form_settings['optin_settings']['update_existing_user'] == 1 ) ? apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( ' To update your MailChimp profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ) : false;
244
  if( $update_account_details_link ) {
245
  // if update account details is set, we need to include our script to send out the update email
246
  wp_enqueue_script( 'update-existing-subscriber.js', YIKES_MC_URL . 'public/js/yikes-update-existing-subscriber.js' , array( 'jquery' ), 'all' );
public/partials/shortcodes/process/process_form_submission_ajax.php CHANGED
@@ -211,7 +211,7 @@
211
  if ( strpos( $error_response, 'should include an email' ) !== false ) { // include a valid email please
212
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['invalid-email'] ) ? $error_messages['invalid-email'] : __( 'Please enter a valid email address.' , 'yikes-inc-easy-mailchimp-extender' ) ) );
213
  } else if ( strpos( $error_response, 'already subscribed' ) !== false ) { // user already subscribed
214
- $update_account_details_link = ( $optin_settings['update_existing_user'] == 1 ) ? apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( 'To update your profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $list_id . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click here', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), '<a class="send-update-email" data-list-id="' . $list_id . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click here', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ) : false;
215
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['already-subscribed'] ) ? $error_messages['already-subscribed'] : __( "It looks like you're already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' ), 'security_response' => $update_account_details_link ) );
216
  } else { // general error
217
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['general-error'] ) ? $error_messages['general-error'] : __( "Whoops, something went wrong! Please try again." , 'yikes-inc-easy-mailchimp-extender' ) ) );
211
  if ( strpos( $error_response, 'should include an email' ) !== false ) { // include a valid email please
212
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['invalid-email'] ) ? $error_messages['invalid-email'] : __( 'Please enter a valid email address.' , 'yikes-inc-easy-mailchimp-extender' ) ) );
213
  } else if ( strpos( $error_response, 'already subscribed' ) !== false ) { // user already subscribed
214
+ $update_account_details_link = ( $optin_settings['update_existing_user'] == 1 ) ? apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( ' To update your profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $list_id . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), '<a class="send-update-email" data-list-id="' . $list_id . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ) : false;
215
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['already-subscribed'] ) ? $error_messages['already-subscribed'] : __( "It looks like you're already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' ), 'security_response' => $update_account_details_link ) );
216
  } else { // general error
217
  wp_send_json( array( 'hide' => '0', 'error' => $error , 'response' => !empty( $error_messages['general-error'] ) ? $error_messages['general-error'] : __( "Whoops, something went wrong! Please try again." , 'yikes-inc-easy-mailchimp-extender' ) ) );
readme.txt CHANGED
@@ -1 +1 @@
1
- === Easy Forms for MailChimp ===
2
- added `stripslashes()` to the following settings fields :
3
- Updated readme FAQ section
4
- added `stripslashes()` to the following settings fields :
5
- Updated readme FAQ section
6
- added `stripslashes()` to the following settings fields :
7
- Updated readme FAQ section
8
- added `stripslashes()` to the following settings fields :
9
- Updated readme FAQ section
1
+ === Easy Forms for MailChimp ===
 
 
 
 
 
 
 
 
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Forms for MailChimp by YIKES
4
  * Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
5
  * Description: YIKES Easy Forms for MailChimp links your site to MailChimp and allows you to generate and display mailing list opt-in forms anywhere on your site with ease.
6
- * Version: 6.0.4.1
7
  * Author: YIKES
8
  * Author URI: http://www.yikesinc.com/
9
  * License: GPL-3.0+
3
  * Plugin Name: Easy Forms for MailChimp by YIKES
4
  * Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
5
  * Description: YIKES Easy Forms for MailChimp links your site to MailChimp and allows you to generate and display mailing list opt-in forms anywhere on your site with ease.
6
+ * Version: 6.0.4.2
7
  * Author: YIKES
8
  * Author URI: http://www.yikesinc.com/
9
  * License: GPL-3.0+