• Resolved samrot

    (@samrot)


    Hi!! Hope you are well.

    We have used a code you gave on another question to name the subject of the chat as the title of the page/post (‘$subject = get_the_title();’).

    When a user hits the message button on a page/post, we would like for the conversation to continue on a previous conversation only if the subject has the same name (aka comes from the same page/post) and to start a new conversation if there is no previous conversation with the same subject name (aka never started a conversation from that same page/post).

    How can we implement this?

    Thank you and best regards!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author wordplus

    (@wordplus)

    Hi there!

    Probably this shortcode with combination of unique tag is better for your purpose:
    https://www.better-messages.com/docs/shortcodes/better_messages_live_chat_button/

    Thanks!

    Thread Starter samrot

    (@samrot)

    Thx for your reply.

    Should the unique_tag be something like the current post id for example ($post_id = get_the_ID();)?

    Plugin Author wordplus

    (@wordplus)

    yes, like “post_123”

    Thread Starter samrot

    (@samrot)

    Applied. So when users don’t have an open conversation already they get a new conversation with the correct subject (from the post title where they hit the PM button) but when the users alredy have a conversation open from another post, it opens that conversation instead of a new one.

    We have fast_start=”1″ on the shortcode and also on the backend configuration of the plugin have activated the ‘Fast start’ option (when fast_start=”0″ on the shortcode no new conversations are created so the users can’t chat).

    Help?

    Plugin Author wordplus

    (@wordplus)

    What did you applied?

    Thread Starter samrot

    (@samrot)

    I have a function with the following:

    $author_title = get_the_author_meta('first_name');
    $subject = get_the_title();
    echo do_shortcode('[better_messages_pm_button text="PM author" subject="' . $subject . '" target="_self" unique_tag="' . $post_id . '" fast_start="1" url_only="0"]');
    Plugin Author wordplus

    (@wordplus)

    Thread Starter samrot

    (@samrot)

    Yes that’s the one I’m using but it’s not working for when the user already have a conversation open with the author from another post, it opens that conversation instead of a new one with the subject of the current post where they click on the pm button.

    The code I sent you was wrong sorry, this is part of the code I’m using:

    $post_id = get_the_ID();
    $subject = get_the_title();
    echo do_shortcode('[better_messages_pm_button text="PM author" subject="' . $subject . '" target="_self" unique_tag="' . $post_id . '" fast_start="1" url_only="0"]');

    What can I do to achieve what we need?

    Thank you! Hope you can help us.

    Thread Starter samrot

    (@samrot)

    sorry, I misunderstood, that link you sent worked perfectly.

    Thx!!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘resume conversation if subject is the same’ is closed to new replies.