Add one more setting to email settings

Home Forums Legacy Support Support queries Other issues Add one more setting to email settings

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #305184
    Makarand Mane
    Spectator
    Hi @alex I tried to add one more option using filter on Email settings under LMS settings. But code is not working.
    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 ) );
    }
    PFA screenshot, where I want to put. https://prnt.sc/ufhylr But new fields not going anywhere.
    #309904
    Anshuman Sahu
    Keymaster
    yup this is an issue please change the code settings as per : https://prnt.sc/ug201e
    #310204
    Makarand Mane
    Spectator
    Hi @alex Is this too correct one?
    $this->settings = apply_filters('wplms_email_settings',$settings);
    $this->lms_settings_generate_form('email_settings', $this->settings);
    Can you please add this patch to update?
    #310222
    Makarand Mane
    Spectator
    Hi @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
    add_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) );
    }
    Use for reply on bp email. default to admin email
    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;
    } 
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Add one more setting to email settings’ is closed to new replies.