Okay
  Public Ticket #3120460
Conversations Module & email Notifications
Closed

Comments

  •  6
    bewconcept started the conversation

    Hello Stefan, 

    I was setting up the conversations module, and the notification by emails settings, and I see only the admin email can be the recipient. 

    Is there a possibility to : 

    - specify a different email or add a second recipent ?


    And if I really want to optimise this module,
    what would be great is to be able to specify a different notification email for specific Subject like : 

    • All technical questions, about order, payment, deliveries, should notify to email recipient A. 

    • All commercial questions and special quotes, goes to email recipient B. 

    so that we can dispatch to 2 different persons, regarding the type of demand. 

    Would be fantastic !! 


    Many thanks

    Robin. 

    Attached files:  Screen_ 2022-09-07 à 18.53.01.png
      Screen_ 2022-09-07 à 20.44.19.png

  •  1,872
    WebWizards replied

    Hi Robin,

    We can set a different email, or multiple email recipients, via a code snippet.

    Here's an example for that:

    add_filter('b2bking_recipient_new_message', function($recipient, $conversationid){
        $recipient = '[email protected], [email protected]';
        return $recipient;
    }, 10, 2);
    

    The above will make it so that 2 emails receive it: [email protected] and [email protected]

    You can add as many as you need with commas,


    ------------

    • All technical questions, about order, payment, deliveries, should notify to email recipient A. 

    • All commercial questions and special quotes, goes to email recipient B. 

    -------------


    We can do that by modifying that snippet. My question is: how do we know which question is technical, or has to do with payments, or is a commercial question? Do you already have a solution for that?

    Are you thinking of adding more options in the dropdown that says 'Inquiry', 'Message', 'Quote Request' ? Have you already implemented that?


    Kind regards,

    Stefan




  •  6
    bewconcept replied

    Hello Stefan, 

    Thanks for the snippet ! 

    To know which demand is what, I was just thinking to use the Subject Dropdown...
    (and change the translation to get something like this ) : 

    We currently have 3 types of Subjects (Dropdown) in Conversations module aka : 

    1/ message (can be used for : Technical questions, returns and deliveries. ) > Sends notification to email A
    2/ quote (stays quote, but I can call it : Commercial questions & Quotes ) > Sends notification to B
    3/ inquiry ( can bu used for more General purpose, products & services, product infos, how to use, etc. : Renseignements produit ) > Sends notification to A and/or B ... 

    And yes i might need to add more discussions type in the future,
    but No i didn't implement that yet.


    Thanks a lot !!

    Robin. 

    Attached files:  Screen_ 2022-09-08 à 14.46.00.png

  •  6
    bewconcept replied

    Also, sorry I forgot, I manage to translate the terms of the module, but I couldn't achieve to translate the name of the type, when you are inside a conversation...

    It seems like maybe these are in hard code still maybe ? 

    Many thanks ! 

    Robin. 

    Attached files:  Screen_ 2022-09-08 à 19.25.55.png
      Screen_ 2022-09-08 à 19.23.44.png

  •  1,872
    WebWizards replied

    Hi Robin,

    That type there is indeed not translatable because it represents the actual value of the conversation type.


    Based on what you described, you can use the following code snippet: https://pastecode.io/s/0qcndahf


    In the first part of that snippet, you can fully control which options are available in that dropdown.

    In the second part of the snippet, you can control the email based on which option the user chose in the dropdown.

    So if the user chose 'returns', the email will go to [email protected] and if the user chose 'technical' it will go to [email protected]

    Of course, these are just examples but you can easily edit this to add any option and setup.


    On the frontend, now I see:

    1902004486.png

    I chose 'return' and the email is correctly send to the email I wanted:

    8656028156.png

     


    We have 1 small problem, the email template thinks it's a quote request, because it doesn't recognize the type and defaults to quote;

    7700566284.png

    To fix this, you need to copy b2bking/includes/emails/templates/new-message-email-template.php and copy it directly to your child theme and modify it there per your needs. - more info here on chapter 2: https://woocommerce-b2b-plugin.com/docs/how-to-customize-b2bking-emails/

  •  6
    bewconcept replied

    Hello Stefan, 

    Thanks for the tweak, i'm implementing it now... 

    But I saw another little thing on the consersations itself, it shows "by (username)" in the bottom right of the messages, 

    Is there a way to display the "Friendly name", and not the actual wp username instead ? 

    Many thanks
    Robin. 


    Attached files:  Screen_ 2022-10-03 à 17.22.13.png

  •   WebWizards replied privately
  •   bewconcept replied privately
  •   WebWizards replied privately
  •   bewconcept replied privately
  •   WebWizards replied privately
  •  6
    bewconcept replied

    Ok, works ok for the decimal indeed !

    still 1 little thing, is that with Variable products, all variations has it's own SKU, and when a product is variable, it shows the product ID as #xxx... this could be a little confusing

    many thanks
    Robin

    Attached files:  Screen_ 2022-11-14 à 04.35.38.png

  •  1,872
    WebWizards replied

    Here we are using WooCommerce's get_formatted_name() function, and this is how it works: it shows SKU if it exists, otherwise it shows ID.

    I do see how it could be confusing.


    One option would be to replace the shortcode with this:

    [b2bking_bulkorder theme=cream sku=yes]
    


    By adding 'sku=yes' as a parameter, there will be a special column for the SKU like this, and ID will not be shown anymore:

    5516461202.png


    Do you think that would work in your situation?

  •  6
    bewconcept replied

    that's what I thought... for the SKU

    ok yes SKU in separate column would be better.

    But I don't understand where to usr this shortcode...? The "bulk Order Form" being activated via your Settings panel... so ... ?

    many thanks

     

  •  1,872
    WebWizards replied

    Oh, in that case you can add this PHP code snippet to your site:

    add_filter('b2bking_my_account_bulkorder_shortcode', function($shortcode){
           return '[b2bking_bulkorder theme=cream sku=yes]';
    }, 10, 1);
    

    This snippet overrides the default shortcode in My Account.

  •  6
    bewconcept replied

    Hello Stefan, 

    There is a little Bug on the Conversation module. 

    When you Star a new conversation, and if you want to save as draft, (to go back to check for the username for example) the trying to complete the message, the Client Filed isn't editable... drop down is missing. 

    Kind Regards,
    Robin. 


    Attached files:  Screen_ 2022-12-01 à 14.36.33.png

  •   WebWizards replied privately