populate from/reply_to for signup confirmation

- added loading screen to reinstall process
This commit is contained in:
Jonathan Labreuille
2016-03-24 14:13:46 +01:00
parent f15374de43
commit 97f0e512af
3 changed files with 16 additions and 19 deletions

View File

@ -82,28 +82,24 @@ class Populator {
private function createDefaultSettings() { private function createDefaultSettings() {
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
// user name // default sender info based on current user
$user_name = ''; $sender = array(
if($current_user->user_firstname) { 'name' => $current_user->display_name,
$user_name = $current_user->user_firstname; 'address' => $current_user->user_email
} );
if($current_user->user_lastname) {
if($user_name) {
$user_name .= ' '.$current_user->user_lastname;
}
}
if(!$user_name) {
$user_name = $current_user->display_name;
}
// default from name & address // default from name & address
Setting::setValue('sender', array( Setting::setValue('sender', $sender);
'name' => $user_name,
'address' => $current_user->user_email
));
// enable signup confirmation by default // enable signup confirmation by default
Setting::setValue('signup_confirmation.enabled', true); Setting::setValue('signup_confirmation', array(
'enabled' => true,
'from' => array(
'name' => get_option('blogname'),
'address' => get_option('admin_email')
),
'reply_to' => $sender
));
} }
private function createDefaultSegments() { private function createDefaultSegments() {

View File

@ -41,7 +41,7 @@ class Setting extends Model {
'signup_confirmation' => array( 'signup_confirmation' => array(
'enabled' => true, 'enabled' => true,
'subject' => sprintf(__('Confirm your subscription to %1$s'), get_option('blogname')), 'subject' => sprintf(__('Confirm your subscription to %1$s'), get_option('blogname')),
'body' => __("Hello!\n\nHurray! You've subscribed to our site.\nWe need you to activate your subscription to the list(s): [lists_to_confirm] by clicking the link below: \n\n[activation_link]Click here to confirm your subscription.[/activation_link]\n\nThank you,\n\nThe team!") 'body' => __("Hello!\n\nHurray! You've subscribed to our site.\n\nWe need you to activate your subscription to the list(s): [lists_to_confirm] by clicking the link below: \n\n[activation_link]Click here to confirm your subscription.[/activation_link]\n\nThank you,\n\nThe team!")
) )
); );
} }

View File

@ -190,6 +190,7 @@
if(confirm( if(confirm(
"<%= __('If you confirm this, all your current MailPoet data will be erased (newsletters, statistics, subscribers, etc...)') %>" "<%= __('If you confirm this, all your current MailPoet data will be erased (newsletters, statistics, subscribers, etc...)') %>"
)) { )) {
MailPoet.Modal.loading(true);
MailPoet.Ajax.post({ MailPoet.Ajax.post({
'endpoint': 'setup', 'endpoint': 'setup',
'action': 'reset' 'action': 'reset'