Choose a recipient on click


Home Forums Front End PM PRO Choose a recipient on click

This topic is: Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8136
    Fabien
    Participant

    I’ve used the free version of your plugin before and it was really simple to fill in recipient input using JS by setting up values to certain inputs on click. That was my code:

    $(document).on(‘click’,’.recipients-list span’, function(){
    $recipientname = $(this).html();
    $recipientnick = $(this).attr(‘data-nickname’);
    $(‘#fep-message-top’).val($recipientname );
    $(‘#fep-message-to’).val($recipientnick );
    });

    Now, with the PRO version, I get “You must enter valid recipient!” error (screen: https://gyazo.com/9d511745db93e13e8789f7aa9065fdcd) despite I prepend

    “<li class=”token-input-token-facebook”><p>’+$recipientname+'</p><span class=”token-input-delete-token-facebook”>×</span>” before .token-input-input-token-facebook as it’s done after I type it manually in the dropdown list – I guess the condition whether recipient is filled in or not triggers via ajax, could you help me with this? How can I improve my code now with the PRO version? That’s really important, I don’t want my users to type recipients manually.

    And btw I bought your plugin only because of the following bug – site url is missing in the email template when I get a new message – it starts with message page URL (check below) and as you don’t allow to edit email templates in the free version I was forced to buy your plugin to face to another problem.

    Please help me either to fix the following bug or trigger filling recipient input on click without typing it manually.

    Email template:

    “Website name”
    From: kestioadmin
    Subject: Subject
    Please Click the following link to view full Message.
    /en/my-account/messages?fepaction=messagebox

    #8144
    shamim
    Keymaster

    For message page url in email you can set “Front End PM Page” in Dashboard > Front End PM PRO > Settings > General.

    To auto fill your selected users, you can use https://www.shamimsplugins.com/docs/front-end-pm-pro/getting-started-2/only-admin/ ( users do not have to be admin, you can use normal users also in that list).

    If you want to pre-populate (without click), you can use https://www.shamimsplugins.com/docs/front-end-pm/customization/user-name-pre-populate-new-message/ , for multiple users you can pass their id’s separated by comma.

    You can even use https://www.shamimsplugins.com/docs/front-end-pm/shortcode/fep_shortcode_new_message_form/ (here you can easily change value by JS).

    If you want to select onclick (what you are showing in your screencast) you can use selector.tokenInput("add", {id: x, name: y}); where “id” is user id and “name” is user display name. If you want to select one recipient only, you can call selector.tokenInput("clear"); before adding.

    Let me know.

    #8154
    Fabien
    Participant

    Thanks for your help Shamim!
    For everyone who’s looking for the same answer – it’s also a must to add return false; – either way, you’ll get an error.

    
    $(document).on('click','.prepoludatedselector', function(){
       $('#fep_mr_to').tokenInput("add", {id: 1, name: "NAME"});
       return false;
    });
    
    #33327
    Faynah Faynah
    Participant
    This reply has been marked as private.
    #33340
    shamim
    Keymaster

    You can follow https://www.shamimsplugins.com/docs/front-end-pm/customization/send-welcome-message-user-register/
    If you have any more question please create a new topic.

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.