I see even I asked you to follow the message system:
=> https://toolset.com/documentation/legacy-features/miscellaneous/how-to-create-a-messaging-system-with-toolset/
I see you did not make any changes as per the message system and that is why its not working.
To the following from - i've added the following generic fields:
=> versteckter Link
[cred_generic_field field='wpcf-message-from' type='hidden' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist":1,
"generic_type":"user_id",
"default":"[wpv-current-user info='id']"
}
[/cred_generic_field]
[cred_generic_field field='wpcf-message-to' type='hidden' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist":1,
"generic_type":"user_id",
"default":"[cust_get_author_meta type='id']"
}
[/cred_generic_field]
I've also adjusted the code to code snippet "passinfotocontact" added at "Custom Code" section as given under:
function cust_get_author_meta($atts) {
if(isset($_GET['parent_empresa_id'])){
$post_id = $_GET['parent_empresa_id'];
$post = get_post($post_id);
$all_data = get_userdata($post->post_author);
if(isset($atts['type']) and $atts['type']=='id'){
return $all_data->data->ID;
}else{
return $all_data->data->user_email;
}
}
}
add_shortcode( 'cust_get_author_meta', 'cust_get_author_meta' );
add_action( 'cred_save_data_2382', 'func_set_first_message_id_field', 10, 2 );
function func_set_first_message_id_field( $post_id, $form_data ) {
update_post_meta( $post_id, 'wpcf-first-message-id', $post_id );
}
As you can see I've adjusted the code for custom shortcode "cust_get_author_meta" and also added hook "cred_save_data_2382".
This is the view used to display the Received Message:
=> versteckter Link
Then, to the personal details page:
=> versteckter Link
i've added the view as given under:
[wpv-view name="my-messages-received" info="[wpv-current-user info='id']"]
When I visit the page personal area page on frontend logged in as User A, under the section "Direct messages received" I can see the message.
=> versteckter Link
Please make sure once you send the message, you must approve it.
Please kindly follow the Doc I shared and make sure your Reply Message form should hold the correct fields as stated with the following Doc:
=> https://toolset.com/documentation/legacy-features/miscellaneous/how-to-create-a-messaging-system-with-toolset/#reply-message-form