Home › Forums › Front End PM PRO › Choose a recipient on click
- This topic has 4 replies, 3 voices, and was last updated 5 years, 10 months ago by Shamim Hasan.
-
AuthorPosts
-
November 23, 2017 at 5:43 am #8136FabienParticipant
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=messageboxNovember 23, 2017 at 10:51 am #8144Shamim HasanKeymasterFor 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 callselector.tokenInput("clear");before adding.Let me know.
November 23, 2017 at 7:39 pm #8154FabienParticipantThanks 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; });January 17, 2020 at 1:35 am #33327Faynah FaynahParticipantThis reply has been marked as private.January 17, 2020 at 11:38 am #33340Shamim HasanKeymasterYou 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. -
AuthorPosts
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.