How do you use it? As far as I could read from the code, I needed to do the following:
//Send private message to guest.
$message['message_to_id'] = $guest_id;
$message['message_title'] = $current_user->user_firstname . __(' confirmed you', 'text-domain');
$message['message_content'] = __('You have been confirmed as a guest on ','text-domain') . get_post_meta($event_id, '_job_title', true);
fep_send_message($message);
Are there more requirements than the three fields? When sending messages from the system.
If you do not set post_author then sender will be current user
How would that look? I’ve looked through the code and came up with the following, which does not work:
//Send private message to guest.
$message['message_to_id'] = $guest_id;
$message['post_author'] = 1; //TODO: Change to System user ID
$message['message_title'] = $full_name . __(' have confirmed you', 'text-domain');
$message['message_content'] = __('You have been confirmed') . '"' . get_post_meta($event_id, '_job_title', true) . '"';
fep_send_message($message);
How can you set the post_author? So the “from user” is not the current user?
Btw. the latest commit fixed the unread message count problem!
Thanks!
second argument support $override as array. Supply any value which you want to override.
try following way
//Send private message to guest.
$message['message_to_id'] = $guest_id;
//$message['post_author'] = 1; //TODO: Change to System user ID
$message['message_title'] = $full_name . __(' have confirmed you', 'text-domain');
$message['message_content'] = __('You have been confirmed') . '"' . get_post_meta($event_id, '_job_title', true) . '"';
$override = array (
'post_author' => $author_id
);
fep_send_message($message, $override );
Also let me know if you found issue about nicename with dashes.
Thank you Shamim! That worked straight away.
There was no problem regarding dashes, I found that someone had switched on some caching, preventing me from seeing any arriving messages.
Everything working perfectly as of now – great plugin!
hi
i tried frontend pm i want to know is it possible,
my requirement is
i want a system i which user can only send message to admin (TO column is hidden, it by default is set to admin)
second a user and admin see all previous conversation between them in one place