David

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 110 total)
  • Author
    Posts
  • in reply to: Unsubscribe link in bottom of email #41877
    David
    Participant

    Hi Shamim,

    I think it would be a great addition to the plugin if we could add the user ID info to the notification emails so that they could be passed as a URL parameter for example to unsubscribe using fep_update_user_option( ‘allow_emails’, 0 ‘$userID’ ) without the need to be logged in.

    Is there any chance this could be incorporated in a future version?

    in reply to: Find Messages in Query and then Update Meta #41871
    David
    Participant

    Oh man, I have fallen to that one before and I didn’t even spot it…

    Ok, now it works. I really appreciate your help!!

    Thank you!

    in reply to: Find Messages in Query and then Update Meta #41863
    David
    Participant

    Here is the full code:

    $busman = fep_get_meta( fep_get_parent_id(fep_get_the_id()), ‘cus_fep_business’, true );
    $args = array(
    ‘mgs_type’ => ‘message’,
    ‘mgs_status’ => ‘publish’,
    ‘mgs_parent’ => 0,
    ‘per_page’ => 10,
    ‘fields’ => [ ‘mgs_id’, ‘mgs_title’ ],
    ‘participant_query’ =>
    [
    [
    ‘mgs_participant’ => $busman,
    ],
    ],
    ‘meta_query’ =>
    [
    [
    ‘key’ => ‘cus_fep_update’,
    ‘value’ => ‘driverupdate’,
    ],
    ],
    );

    $mgs = fep_get_messages( $args );
    if ( $mgs ) {
    foreach ( $mgs as $mg ) {
    fep_update_meta( $mg->mgs_id, ‘test_meta’, ‘test’ );
    }
    }
    wp_reset_query();

    If I add this code into the page and load it as normal, all of the messages update with the new meta. However, if I add this code into add_action( ‘fep_action_message_after_send’, function( $message_id, $message, $new_message ){ it does not work. That action is working ok for all the other meta that is being added and updated in it.

    Debugging is something that is beyond my skill set at the moment but I will look into it. Any other ideas you have would be appreciated.

    in reply to: Find Messages in Query and then Update Meta #41853
    David
    Participant

    It is using fep_action_message_after_send

    in reply to: Maintain Messages in Database after user deletion #41725
    David
    Participant

    Thanks, I have sent you a message through the contact form.

    in reply to: Maintain Messages in Database after user deletion #41714
    David
    Participant

    Thanks for the quick reply.

    Not quite…

    Here is the flow:

    1. User a and user b communicate with messages.

    2. A booking is completed. The booking confirmation contains the link to the parent message which now has fep meta ‘booking_confirmed’.

    3. User a and user b can delete the message thread from the message box.

    4. After message deletion, for either user, the message can be accessed from the booking confirmation. They have permission to view the message and can send further messages in the same thread.

    Essentially, when a message is deleted by either user with meta ‘booking_confirmed’ it only means that they cannot see the message in the message box. Everything else is the same. It is more like “hide” message.

    in reply to: Display Info on Latest Message in thread #41622
    David
    Participant

    Yes, it works perfectly. Many thanks!

    in reply to: If any participant is Admin #31586
    David
    Participant

    Thanks!!

    in reply to: If any participant is Admin #31581
    David
    Participant

    sorry, yes, user with administrator role. There is only 1. I can also do it by user ID number which is 1 if that helps.

    in reply to: Need to Update Message Title from Reply Message Meta #30712
    David
    Participant

    Thanks very much Shamim. It is working now 🙂

    I appreciate your help in this!

    in reply to: Need to Update Message Title from Reply Message Meta #30707
    David
    Participant

    add_action( ‘fep_action_message_after_send’, function( $message_id, $message, $new_message ){
    $message_parent = fep_get_parent_id(fep_get_the_id());
    $message_reply = fep_get_message( $message_parent );
    $message_reply->update( [ ‘mgs_title’ => ‘UPDATED TITLE HERE’ ] );
    }, 10, 3);

    in reply to: Need to Update Message Title from Reply Message Meta #30699
    David
    Participant

    Sorry, please updated last:

    “I get the error as mentioned before. I have checked the output of $message_parent and it is 495.”

    in reply to: Need to Update Message Title from Reply Message Meta #30696
    David
    Participant

    Hi again,

    Ok, if I do this:

    $message_reply = fep_get_message( 495 );
    $message_reply->update( [ ‘mgs_title’ => ‘UPDATED TITLE HERE’ ] );

    it works ok.

    However, when I make it dynamic:

    $message_parent = fep_get_parent_id(fep_get_the_id());
    $message_reply = fep_get_message( $message_parent );
    $message_reply->update( [ ‘mgs_title’ => ‘UPDATED TITLE HERE’ ] );

    I get the error as mentioned before. I have checked the output of $message_reply and it is 495.

    Even after a refresh it does not update.

    Let me know what you need in order to have a look at the site.

    Thanks for your help.

    in reply to: Need to Update Message Title from Reply Message Meta #30592
    David
    Participant

    Thanks very much but I am having a couple of issues…

    First the message does not send:
    I see “Refresh this page and try again.” When I refresh the page it works.
    There is an error:
    Failed to load resource: the server responded with a status of 500 () for wp-admin/admin-ajax.php.

    Second, I need the fep_get_message( 1 ) to be dynamic as the parent of the current message.

    Thanks for your help..

    in reply to: Need to Update Message Title from Reply Message Meta #30580
    David
    Participant

    Thanks but that is giving an error:

    Parse error: syntax error, unexpected ‘=>’ (T_DOUBLE_ARROW), expecting ‘,’ or ‘)’

    I tried

    $message = fep_get_message( 1 ); //1 is message id which title you want to update
    $message->update( ‘mgs_title’, ‘UPDATED TITLE HERE’ );

    but that did not work either.

Viewing 15 posts - 16 through 30 (of 110 total)