Version Description
- Added multiple hooks to filter all about emails being sent when importing
- Included new variables in hooks that already exists in emails being sent when importing
Download this release
Release Info
Developer | carazo |
Plugin | Import users from CSV with meta |
Version | 1.15.6.6 |
Comparing to | |
See all releases |
Code changes from version 1.15.6.5 to 1.15.6.6
- import-users-from-csv-with-meta.php +1 -1
- importer.php +19 -14
- readme.txt +5 -1
import-users-from-csv-with-meta.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Import and export users and customers
|
4 |
Plugin URI: https://www.codection.com
|
5 |
Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
|
6 |
-
Version: 1.15.6.
|
7 |
Author: codection
|
8 |
Author URI: https://codection.com
|
9 |
License: GPL2
|
3 |
Plugin Name: Import and export users and customers
|
4 |
Plugin URI: https://www.codection.com
|
5 |
Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
|
6 |
+
Version: 1.15.6.6
|
7 |
Author: codection
|
8 |
Author URI: https://codection.com
|
9 |
License: GPL2
|
importer.php
CHANGED
@@ -597,51 +597,56 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
|
|
597 |
$key = get_password_reset_key( $user_object );
|
598 |
$user_login= $user_object->user_login;
|
599 |
|
600 |
-
$
|
601 |
$subject = get_option( "acui_mail_subject" );
|
602 |
|
603 |
-
$
|
604 |
-
$
|
605 |
-
$
|
606 |
$subject = str_replace( "**username**", $user_login, $subject );
|
607 |
|
608 |
if( !is_wp_error( $key ) ){
|
609 |
$passwordreseturl = apply_filters( 'acui_email_passwordreseturl', network_site_url( 'wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode( $user_login ), 'login' ) );
|
610 |
-
$
|
611 |
|
612 |
$passwordreseturllink = wp_sprintf( '<a href="%s">%s</a>', $passwordreseturl, __( 'Password reset link', 'import-users-from-csv-with-meta' ) );
|
613 |
-
$
|
614 |
}
|
615 |
|
616 |
if( empty( $password ) && !$created ){
|
617 |
$password = __( 'Password has not been changed', 'import-users-from-csv-with-meta' );
|
618 |
}
|
619 |
|
620 |
-
$
|
621 |
-
$
|
622 |
|
623 |
foreach ( $wp_users_fields as $wp_users_field ) {
|
624 |
if( $positions[ $wp_users_field ] != false && $wp_users_field != "password" ){
|
625 |
-
$
|
626 |
$subject = str_replace( "**" . $wp_users_field . "**", $data[ $positions[ $wp_users_field ] ] , $subject );
|
627 |
}
|
628 |
}
|
629 |
|
630 |
for( $i = 0 ; $i < count( $headers ); $i++ ) {
|
631 |
$data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
|
632 |
-
$
|
633 |
$subject = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $subject );
|
634 |
}
|
635 |
|
636 |
-
$
|
637 |
-
|
638 |
-
|
639 |
$attachments = array();
|
640 |
$attachment_id = get_option( 'acui_mail_attachment_id' );
|
641 |
if( !empty( $attachment_id ) )
|
642 |
$attachments[] = get_attached_file( $attachment_id );
|
643 |
|
644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
645 |
endif;
|
646 |
|
647 |
endif;
|
597 |
$key = get_password_reset_key( $user_object );
|
598 |
$user_login= $user_object->user_login;
|
599 |
|
600 |
+
$body = get_option( "acui_mail_body" );
|
601 |
$subject = get_option( "acui_mail_subject" );
|
602 |
|
603 |
+
$body = str_replace( "**loginurl**", wp_login_url(), $body );
|
604 |
+
$body = str_replace( "**username**", $user_login, $body );
|
605 |
+
$body = str_replace( "**lostpasswordurl**", wp_lostpassword_url(), $body );
|
606 |
$subject = str_replace( "**username**", $user_login, $subject );
|
607 |
|
608 |
if( !is_wp_error( $key ) ){
|
609 |
$passwordreseturl = apply_filters( 'acui_email_passwordreseturl', network_site_url( 'wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode( $user_login ), 'login' ) );
|
610 |
+
$body = str_replace( "**passwordreseturl**", $passwordreseturl, $body );
|
611 |
|
612 |
$passwordreseturllink = wp_sprintf( '<a href="%s">%s</a>', $passwordreseturl, __( 'Password reset link', 'import-users-from-csv-with-meta' ) );
|
613 |
+
$body = str_replace( "**passwordreseturllink**", $passwordreseturllink, $body );
|
614 |
}
|
615 |
|
616 |
if( empty( $password ) && !$created ){
|
617 |
$password = __( 'Password has not been changed', 'import-users-from-csv-with-meta' );
|
618 |
}
|
619 |
|
620 |
+
$body = str_replace( "**password**", $password, $body );
|
621 |
+
$body = str_replace( "**email**", $email, $body );
|
622 |
|
623 |
foreach ( $wp_users_fields as $wp_users_field ) {
|
624 |
if( $positions[ $wp_users_field ] != false && $wp_users_field != "password" ){
|
625 |
+
$body = str_replace( "**" . $wp_users_field . "**", $data[ $positions[ $wp_users_field ] ] , $body );
|
626 |
$subject = str_replace( "**" . $wp_users_field . "**", $data[ $positions[ $wp_users_field ] ] , $subject );
|
627 |
}
|
628 |
}
|
629 |
|
630 |
for( $i = 0 ; $i < count( $headers ); $i++ ) {
|
631 |
$data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
|
632 |
+
$body = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $body );
|
633 |
$subject = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $subject );
|
634 |
}
|
635 |
|
636 |
+
$body = wpautop( $body );
|
637 |
+
|
|
|
638 |
$attachments = array();
|
639 |
$attachment_id = get_option( 'acui_mail_attachment_id' );
|
640 |
if( !empty( $attachment_id ) )
|
641 |
$attachments[] = get_attached_file( $attachment_id );
|
642 |
|
643 |
+
$email_to = apply_filters( 'acui_import_email_to', $email, $headers, $data, $created );
|
644 |
+
$subject = apply_filters( 'acui_import_email_subject', $subject, $headers, $data, $created );
|
645 |
+
$body = apply_filters( 'acui_import_email_body', $body, $headers, $data, $created );
|
646 |
+
$headers_mail = apply_filters( 'acui_import_email_headers', array( 'Content-Type: text/html; charset=UTF-8' ), $headers, $data );
|
647 |
+
$attachments = apply_filters( 'acui_import_email_attachments', $attachments, $headers, $data, $created );
|
648 |
+
|
649 |
+
wp_mail( $email_to, $subject, $body, $headers_mail, $attachments );
|
650 |
endif;
|
651 |
|
652 |
endif;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://codection.com/go/donate-import-users-from-csv-with-meta/
|
|
4 |
Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.4.1
|
7 |
-
Stable tag: 1.15.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -99,6 +99,10 @@ Plugin will automatically detect:
|
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
|
|
102 |
= 1.15.6.5 =
|
103 |
* Users only can import users with a role that they allowed to edit (thanks to @nonprofitweb https://wordpress.org/support/topic/import-user-with-higher-role/)
|
104 |
|
4 |
Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.4.1
|
7 |
+
Stable tag: 1.15.6.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
99 |
|
100 |
== Changelog ==
|
101 |
|
102 |
+
= 1.15.6.6 =
|
103 |
+
* Added multiple hooks to filter all about emails being sent when importing
|
104 |
+
* Included new variables in hooks that already exists in emails being sent when importing
|
105 |
+
|
106 |
= 1.15.6.5 =
|
107 |
* Users only can import users with a role that they allowed to edit (thanks to @nonprofitweb https://wordpress.org/support/topic/import-user-with-higher-role/)
|
108 |
|