Home › Forums › Legacy Support › Support queries › Other issues › Add one more setting to email settings
Tagged: Email, email settings, rely-to
- This topic has 3 replies, 2 voices, and was last updated 4 years, 3 months ago by Makarand Mane.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
September 11, 2020 at 11:06 am #305184Makarand ManeSpectatorHi @alex I tried to add one more option using filter on Email settings under LMS settings. But code is not working.
PFA screenshot, where I want to put. https://prnt.sc/ufhylr But new fields not going anywhere.add_filter( 'wplms_email_settings', 'cmp_wplms_email_settings', 9999 ); function cmp_wplms_email_settings( $settings ){ $new_option = array( 'label' => __('Reply-To "Email"','vibe-customtypes'), 'name' =>'reply_to_email', 'type' => 'text', 'desc' => __('Email to which student should reply','vibe-customtypes') ); return array_merge( $settings, array( $new_option ) ); }
September 12, 2020 at 12:22 pm #309904Anshuman SahuKeymasteryup this is an issue please change the code settings as per : https://prnt.sc/ug201eSeptember 14, 2020 at 6:09 am #310204Makarand ManeSpectatorHi @alex Is this too correct one?
Can you please add this patch to update?$this->settings = apply_filters('wplms_email_settings',$settings); $this->lms_settings_generate_form('email_settings', $this->settings);
September 14, 2020 at 6:52 am #310222Makarand ManeSpectatorHi @alex one more recommendation. See if you could add this option to settings. So this might be more useful for everyone. Here is my code. Add option
Use for reply on bp email. default to admin emailadd_filter( 'wplms_email_settings', 'cmp_wplms_email_settings', 9999 ); function cmp_wplms_email_settings( $settings ){ $new_option = array( array( 'label' => __('Reply-To "Email"','vibe-customtypes'), 'name' =>'reply_to_email', 'type' => 'text', 'desc' => __('Email to which student should reply on recevied email.','vibe-customtypes') ) ); return array_merge( array_slice($settings, 0, 2), $new_option, array_slice($settings, 2) ); }
add_filter( 'bp_email_set_reply_to', 'cmp_reply_to_email', 999 ); function cmp_reply_to_email( $retval ) { if(class_exists('WPLMS_tips')){ $wplms_settings = WPLMS_tips::init(); $settings = $wplms_settings->lms_settings; }else{ $settings = get_option('lms_settings'); } if(!empty($settings['email_settings']) && !empty($settings['email_settings']['reply_to_email'])){ return new BP_Email_Recipient( $settings['email_settings']['reply_to_email'] ); } return $retval; }
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Add one more setting to email settings’ is closed to new replies.