Support » Plugin: WordPress File Upload » mailto link in notification email

  • hello
    in the email notification that i send, i add a link to the file using the % links.
    however, in the final email, the link to the file is preceded with a “mailto:” tag so if clicked it launched the link in a new email.
    i cant work out what im doing wrong!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi, can you send me the shortcode of the upload form to check?

    Regards

    Nickolas

    Thread Starter billyqureshi

    (@billyqureshi)

    you know what, i think the issue is actually down to my mail provider as it doesn’t happen when i use another email address. sorry for this, but if you can answer one other thing i would be very grateful…

    in the upload success message that is displayed on the page, i cant use field values (like you can in the email notification).
    i want to include the url to the file in the success message, and the url is “domain.com/uploads/emailaddress/filename”
    but i cant add the email address tag in the url.
    i cant use %filepath% as it just shows the path from the web root, not the domain.

    is this possible to add the email field to this message?

    Plugin Author nickboss

    (@nickboss)

    You can use the following hook:

    
    if ( isset($GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"]) ) $GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"][3] = "ON";
    if (!function_exists('wfu_process_files_alt')) {
        function wfu_process_files_alt($res, $params, $method) {
            $sid = $params["uploadid"];
            $hiddeninput = 'hiddeninput_'.$sid;
            $userdata_fields = $params["userdata_fields"]; 
            $search = array ();
            $replace = array ();
            foreach ( $userdata_fields as $userdata_key => $userdata_field ) {
                $value = ( isset($_POST[$hiddeninput.'_userdata_'.$userdata_key]) ? strip_tags($_POST[$hiddeninput.'_userdata_'.$userdata_key]) : "" );
                $ind = 1 + $userdata_key;
                array_push($search, '/%userdata'.$ind.'%/');  
                array_push($replace, $value);
            }
            $params['successmessage'] = preg_replace($search, $replace, $params['successmessage']);
            $res["vars"]["params"] = $params;
            $res["result"] = "X";
            return $res;
        }
        add_filter('wfu_debug-wfu_process_files', 'wfu_process_files_alt', 10, 3);
        $GLOBALS['wfu_debug-wfu_process_files'] = "1";
    }
    

    You need to put it in functions.php of your theme. Then, if you want to put a userdata field value, you can put %userdata1% or %userdata2% etc. inside Success Message label.

    Regards

    Nickolas

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.