Home › Forums › Front End PM PRO › Page URL in Message
- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by Shamim Hasan.
- AuthorPosts
- December 27, 2017 at 8:05 pm #8881Ricardo CosentinoParticipant
Hello, I’m using Front End PM PRO as a tool to help my users to ask questions, because I have many differents courses with many Modules with many lessons in each module, I got it putting in every page a button that open a lightbox with a form to send the text to our teachers. It’s working perfectly, but I want to facilitate for the teachers, because when an user send a doubt in the messagebox panel only shows in the message title the name of the page that the user sent, I would like to know if is possible to send the url link in the body message or something like that, because when the teachers recieve a message is very hard to find what lesson the user sent only with the page title
I’m using the shortcode: [fep_shortcode_new_message_form subject="<?php wp_title();?>"]
Thank you!
December 28, 2017 at 12:14 am #8884Shamim HasanKeymasterYou can use
fep_filter_message_before_sendfilter to add$_SERVER['HTTP_REFERER']to the message.December 28, 2017 at 4:35 pm #8898Ricardo CosentinoParticipantSorry, I didn’t understand where I need to put this code:
fep_filter_message_before_sendIs like a filter in functions.php? per example:
add_filter( 'fep_filter_message_before_send', $_SERVER['HTTP_REFERER']);Thanks again!
December 28, 2017 at 4:51 pm #8900Ricardo CosentinoParticipantI tried this in function.php:
add_filter( 'fep_filter_message_before_send', 'send_url' ); function send_url() { $url = $_SERVER['HTTP_REFERER']; return $url; }But just recieved error messages!
December 28, 2017 at 5:13 pm #8902Ricardo CosentinoParticipantAfter I tried to send a Message: https://imgur.com/a/LKmBW
I tested a basic filter just to send an alert like that:
add_filter( 'fep_filter_message_before_send', 'send_url' ); function send_url() { echo "<script>alert('".$_SERVER['HTTP_REFERER']."');</script>"; }And it Works but… The message didn’t send
December 28, 2017 at 6:24 pm #8904Shamim HasanKeymasterPlease add following code in your theme’s (child theme’s if any) functions.php
add_filter( 'fep_filter_message_before_send', 'fep_cus_send_url', 999 ); function fep_cus_send_url( $message ) { if( empty( $message['message_content'] ) || $message['post_parent'] ) return $message; $message['message_content'] .= '<div>'; $message['message_content'] .= esc_url( $_SERVER['HTTP_REFERER'] ); $message['message_content'] .= '</div>'; return $message; }Let me know.
- 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.