Craig Tucker

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • in reply to: Getting Message ID in fep_filter_before_email_send #45977
    Craig Tucker
    Participant

    This is working better. However I would like to send a link to the top of the thread rather than to the last link. I am not understanding how that happens in class-fep-emails.php. I have tried using fep_query_url( ‘messagebox’ ) but it is not sufficient. Is there a function that I can use to make the url for $message_id point to the top of the thread?

    add_action( ‘fep_action_message_after_send’, ‘send_sms_with_twilio’, 100, 3 );

    function send_sms_with_twilio( $message_id, $message, $inserted_message ){

    $participants = fep_get_participants( $message_id );
    foreach ( $participants as $participant ) {
    $email = fep_get_userdata( $participant, ‘user_email’, ‘id’ );
    $user = get_user_by( ’email’, $email );
    $userId = $user->ID;
    $phone = get_the_author_meta( ‘phone_number’, $userId );
    $gateway = get_the_author_meta( ‘cell_carrier’, $userId );
    $smsgateway= $phone.$gateway;

    if( preg_match(“/_|@|%/”, $smsgateway) )
    {
    $to = $smsgateway; //the phonenumber@sms.provider
    $subject = ‘New Message at TuckerWorks go to’; //No subject line
    $body = site_url( ‘/client-portal/’, ‘https’ ) . ‘?fepaction=viewmessage&fep_id=’ . $message_id;
    $headers = array(‘Content-Type: text/plain; charset=UTF-8’);
    wp_mail( $to, $subject, $body, $headers );
    }
    }
    }

    in reply to: Getting Message ID in fep_filter_before_email_send #45976
    Craig Tucker
    Participant

    I see I am way off. I am moving to class-fep-emails.php and making mods there. That should work.

    in reply to: Adding tinymce to the fep_shortcode_new_message_form #45974
    Craig Tucker
    Participant

    Perfect. Thanks so much!

    in reply to: Limit Admins to specific roles #45958
    Craig Tucker
    Participant

    I have tried using fep_message_query_args

    //Limit Clinician View in Mailbox to Only their Clients
    add_filter( ‘fep_message_query_args’, function( $args, $user_id ) {
    $current_user = wp_get_current_user();
    $current_user_id = $current_user>id;
    if(array_intersect($current_user->roles, array(‘administrator’, ‘ Amelia Employee’,’Amelia Manager’))) {

    $user_role= ‘client’ . $current_user_id;

    $args1 = array(
    ‘role’ => $user_role,
    ‘orderby’ => ‘id’,
    ‘order’ => ‘ASC’
    );

    $clients = get_users($args1);

    foreach ($clients as $user) {
    $args[‘participant_query’][] = array(
    ‘mgs_participant’ => $user->id,
    ‘mgs_deleted’ => false,
    );
    return $args;
    }
    }
    }, 10, 2 );

    This did not work. The foreach loop is not effective. It appears to need one user id at a time. If, for example, I just feed mgs_participant a single ID all is well for that individual. But I need all individuals who may belong to that clinician to be represented in the message box. If you have any other options I can try to make this happen please let me know.
    Craig

    in reply to: Limit Admins to specific roles #45957
    Craig Tucker
    Participant

    I am wondering about the filter: fep_message_query_args_
    What are the parameters of this? Can I create a custom query to filter what messages appear in the message box?

    Craig

    in reply to: Limit Admins to specific roles #45955
    Craig Tucker
    Participant

    Hello Shamim,

    I am finally getting to my project. I want Doctors to only see their patients in their mail box. I have a clinic with three doctors. I want all doctors on FEP. When patients register they are assigned a user role associated with their doctor.

    I can see how I can use fep_directory_arguments so that if the doctors only their patients in the directory.

    I also need for doctors to only see their patients when they look at the message board. Is there a filter I can use for how messages load into the first page of the message board?

    Or, will I need to edit the template files? If so, which are associated with the front page of the message board?

    Thank you,
    Craig

    in reply to: Limit Admins to specific roles #45952
    Craig Tucker
    Participant

    It looks like fep_directory_arguments may do it?

    in reply to: Search stopped working for one client name #45224
    Craig Tucker
    Participant

    I figured it out. I noticed that the search for user is partially based on user role. The user role had changed. I added the correct role for the user and all is good now.

    Also, in the process I learned how to show first last name using your filter. That was not available in the distant past but I am grateful that it is now. I can now delete Force First Last Name plugin!

    in reply to: Just updated. Can I role back? #26980
    Craig Tucker
    Participant

    Thanks I just noticed that change in your documentation and updated. It seems to work. Thanks.

    in reply to: Just updated. Can I role back? #26971
    Craig Tucker
    Participant

    Taking a closer look. The function that I am using to insert a message upon submission of a Gravity Forms object apparently is not including me as a participant in the discussion now. So it posts to my patient but I am not included as a participant. This is the code that I am using for my function:

    add_action(‘user_register’,’returning_client’);
    function returning_client($user_id){
    // the wp meta_user field we are looking for
    global $wpdb;
    $current_redirect_value = get_user_meta( $user_id, ‘payment’, true );
    update_user_meta( $user_id, ‘renew’, date(“Y-m-d”, strtotime(“-1 years”)));
    if ($current_redirect_value == “returning”){
    $message = array(
    ‘message_title’ => ‘IMPORTANT! It is time to update your information.’,
    ‘message_content’ => ‘<p>Welcome Back!</p>,
    ‘message_to_id’ => $user_ID,
    );
    $override = array(
    ‘post_author’ => 1,
    );
    //Post message in Frontend PM
    $message_id = fep_send_message( $message, $override );
    }
    }

    What would I need to add given your recent updates so that I am posted as a participant in this message?

    in reply to: New update crashed site #18041
    Craig Tucker
    Participant

    Ok, your edit works:

    @include_once ‘PEAR.php’;

    if ( ! class_exists( ‘PEAR’ ) ) {
    require_once __DIR__ . ‘/PEAR.php’;
    }

    All is well, thanks.

    Craig

    in reply to: New update crashed site #18039
    Craig Tucker
    Participant

    No luck with refresh. I have tried on different browsers and still no luck. I am using piping. Modifying open_basedir did not make a difference.

    in reply to: New update crashed site #18031
    Craig Tucker
    Participant

    I am using WordPress 4.9.7

    in the error log:

    [06-Oct-2018 04:28:27 UTC] PHP Warning: require_once(): open_basedir restriction in effect. File(/volume1/@appstore/PEAR/PEAR.php) is not within the allowed path(s): (/var/services/web:/tmp:/var/services/tmp) in /volume1/web/wordpress/wp-content/plugins/front-end-pm-pro/pro/fep-email-parser/mimeDecode.php on line 65
    [06-Oct-2018 04:28:27 UTC] PHP Warning: require_once(/volume1/@appstore/PEAR/PEAR.php): failed to open stream: Operation not permitted in /volume1/web/wordpress/wp-content/plugins/front-end-pm-pro/pro/fep-email-parser/mimeDecode.php on line 65
    [06-Oct-2018 04:28:27 UTC] PHP Fatal error: require_once(): Failed opening required ‘PEAR.php’ (include_path=’.:/var/packages/PEAR/target’) in /volume1/web/wordpress/wp-content/plugins/front-end-pm-pro/pro/fep-email-parser/mimeDecode.php on line 65

    in reply to: New update crashed site #18029
    Craig Tucker
    Participant

    Yep, tried it again. Version 10.1.3. White screen. [HTTP/1.1 500 Internal Server Error 2061ms]. I will try the debugging.

    in reply to: Help with Version 10.1.1 Database Changes #17474
    Craig Tucker
    Participant

    Thanks, your edit is perfect:

    
    		$attachment[] = array(
    		 'att_file' => $pathtofile,
    		 'att_mime' => 'application/pdf',
    		);
    		//Add attachment to Frontend PM post
           FEP_Attachments::init()->insert( $message_id, $attachment );
    

    I can clearly see that your modification the the database is much better. Now on to OpenEMR. I will look at FEP_Message_Query. Thanks again,
    Craig

Viewing 15 posts - 1 through 15 (of 35 total)