Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter summitwinterguard

    (@summitwinterguard)

    Bumping question

    Plugin Author nickboss

    (@nickboss)

    Hi, %filepath% variable provides the path of the file in the web server’s file system, not the URL. It should be used only for emails sent to admins.

    The URL is not currently supported as a variable. However it can be done with a plugin hook. Here it is:

    if (!function_exists('wfu_before_email_notification_handler')) {
    	function wfu_before_email_notification_handler($changable_data, $additional_data) {
    		$sep = ", ";
    		$fileurls = explode(",", $changable_data["filepath"]);
    		foreach ( $fileurls as $ind => $fileurl )
    			$fileurls[$ind] = rawurlencode(str_replace(ABSPATH, site_url()."/", trim($fileurl)));
    		$changable_data["message"] = str_replace("%fileurl%", implode($sep, $fileurls), $changable_data["message"]);
    		return $changable_data;
    	}
    	add_filter('wfu_before_email_notification', 'wfu_before_email_notification_handler', 10, 2); 
    }

    You need to put it in functions.php file of your theme.

    Then, user variable %fileurl%. It will be replaced by the URL of the file inside the email.

    Nickolas

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email Link’ is closed to new replies.