From 6cf373807d1ea716ca99d2e0a90d9bec7c4e7177 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 2 Oct 2008 11:47:10 +0000 Subject: Send welcome email to users when blog created from backend. git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1501 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/wpmu-edit.php | 2 ++ wp-includes/wpmu-functions.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php index 91d2d41..ed93577 100644 --- a/wp-admin/wpmu-edit.php +++ b/wp-admin/wpmu-edit.php @@ -113,6 +113,7 @@ switch( $_GET['action'] ) { $path = $base.$domain.'/'; } + $password = 'N/A'; $user_id = email_exists($email); if( !$user_id ) { $password = generate_random_password(); @@ -132,6 +133,7 @@ switch( $_GET['action'] ) { update_user_option( $user_id, 'primary_blog', $id, true ); $content_mail = sprintf( __( "New blog created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain.$path, stripslashes( $title ) ); wp_mail( get_site_option('admin_email'), sprintf(__('[%s] New Blog Created'), $current_site->site_name), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); + wpmu_welcome_notification( $id, $user_id, $password, $title, array( "public" => 1 ) ); wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'add-blog'), $_SERVER['HTTP_REFERER'] ) ); exit(); } else { diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index c452171..ba7017b 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1480,7 +1480,7 @@ SITE_NAME" ) ); $message = $welcome_email; if( empty( $current_site->site_name ) ) $current_site->site_name = "WordPress MU"; - $subject = sprintf(__('New %1$s Blog: %2$s'), $current_site->site_name, $title); + $subject = sprintf(__('New %1$s Blog: %2$s'), $current_site->site_name, stripslashes( $title ) ); wp_mail($user->user_email, $subject, $message, $message_headers); return true; } -- cgit