• Resolved jewfrojack

    (@jewfrojack)


    Hi, I’m using the latest version of WordPress and the plugin and the e-mail notification doesn’t work, the code is the following:

    [wordpress_file_upload placements=”message/userdata/userdata/userdata/userdata/filename/selectbutton+uploadbutton” uploadtitle=”Ingreso Abstract” selectbutton=”Seleccionar” uploadbutton=”Subir Abstract” successmessage=”Abstract %filename% se subió satisfactoriamente ” warningmessage=”Abstract %filename% se subió satisfactoriamente pero genero un problema” errormessage=”Abstract %filename% no pudo ser subido” waitmessage=”Abstract %filename% esta siendo subido en estos momentos” notify=”true” notifyrecipients=”%userdata4%” notifysubject=”Abstract %filename% fue subido satisfactoriamente” notifymessage=”Estimado:%n%%n%Tu abstract %username% fue subido satisfactoriamente y va a ser revisado por nuestro equipo.” userdata=”true” userdatalabel=”Titulo Abstract|t:text|s:top|r:1|a:0|p:none|d:” userdatalabel2=”Autor|t:text|s:top|r:1|a:0|p:none|d:” userdatalabel3=”Usted es académico o estudiante|t:text|s:top|r:1|a:0|p:none|d:” userdatalabel4=”E-Mail|t:email|s:top|r:1|a:0|v:0|p:none|d:|g:1″]

    I’m trying to use the mail set on the field “email” so i notified the users when the file is uploaded.

    As a side question, is there a way to make codes for each file uploaded and add that to the auto-message ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jewfrojack

    (@jewfrojack)

    Mail Fixed, but i still wanna know if there’s a Code option for files, so the user can know the filed was received and located by code.

    Plugin Author nickboss

    (@nickboss)

    Hi, you want the user to receive another email confirming that the file was received?

    Regards

    Nickolas

    Thread Starter jewfrojack

    (@jewfrojack)

    No I make that using the notificatio option I wanna know if there’s a way to generate a unique code for each file that has been uploaded and send that code in the confirmation mail so the user can request the file by the code.

    Sorry if I don’t make myself understand but English is not my native language.

    Ps: awesome app, make everything really simple.

    Plugin Author nickboss

    (@nickboss)

    Hi, yes this can be done using the plugin’s filters. A server script can generate a unique code for each file when it is uploaded and put the code inside the email. The pair unique_code/file_path can be stored in a text file.

    How the user will then request the file using the unique code? By a simple email?

    Nickolas

    Thread Starter jewfrojack

    (@jewfrojack)

    Yes just by mail, its a way to organize the files, like when you buy a ticket, you have the ticket on your hand and at the same time that ticket has a code that makes the ticket unique.

    Well thank you very much for the support and again thank you for this awesome plugin.

    Plugin Author nickboss

    (@nickboss)

    Hi, put the following code at the end of your functions.php file (I suppose you have the Free version):

    
    if (!function_exists('wfu_before_email_notification_handler')) {
    	function wfu_before_email_notification_handler($changable_data, $additional_data) {
    		$ticketfile = ABSPATH."wp-content/tickets.txt";
    		$files = explode(",", $changable_data["filepath"]);
    		$tickets = array();
    		$files_tickets = array();
    		foreach ( $files as $file ) {
    			$file = trim($file);
    			$ticket = wfu_create_random_string(8);
    			array_push($tickets, $ticket);
    			array_push($files_tickets, wfu_basename($file)." -> ".$ticket);
    			file_put_contents($ticketfile, $ticket.": ".$file."\r\n", FILE_APPEND);
    		}
    		$changable_data["message"] = str_replace(array( "%tickets%", "%files_tickets%" ), array( implode("%n%", $tickets), implode("%n%", $files_tickets) ), $changable_data["message"]);
    		return $changable_data;
    	}
    	add_filter('wfu_before_email_notification', 'wfu_before_email_notification_handler', 10, 2); 
    }
    

    The above code will create a unique ticket for every uploaded file and it will store the tickets to the file tickets.txt located inside /wp-content directory. If you want to include the ticket in your email, put the variable %tickets% inside the message body. I have also created another variable, %files_tickets% which displays the filename and the ticket together “filename -> ticket”.

    Please note that the above code will also work if the user uploads multiple files (Pro version).

    Regards

    Nickolas

    Thread Starter jewfrojack

    (@jewfrojack)

    Dude, you’re one of the nicest and best programmer i have ever see, thank you so much for this code and thank you for the effort you put on your plugin.

    Plugin Author nickboss

    (@nickboss)

    you are welcome…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘e-mail notification not working’ is closed to new replies.