Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

external_upload_notify()

Description

Notify the creator of an external upload share that resources have been uploaded

Parameters

ColumnTypeDefaultDescription
$collection int Ref of external shared collection
$k string External upload access key
$tempcollection int Ref of temporay upload collection

Return

void

Location

include/collections_functions.php lines 5629 to 5661

Definition

 
function external_upload_notify($collection$k$tempcollection)
    {
    global 
$applicationname,$baseurl,$lang;

    
$upload_share get_external_shares(array("share_collection"=>$collection,"share_type"=>1"access_key"=>$k));
    if(!isset(
$upload_share[0]["user"]))
        {
        
debug("external_upload_notify() - unable to find external share details: " func_get_args());
        }
    
$user               $upload_share[0]["user"];
    
$templatevars       = array();
    
$url                $baseurl "/?c=" . (int)$collection;
    
$templatevars['url']= $url;    
            
    
$message=$lang["notify_upload_share_new"] . "\n\n"$lang["clicklinkviewcollection"] . "\n\n" $url;
    
$notificationmessage=$lang["notify_upload_share_new"];
        
    
// Does the user want an email or notification?
    
get_config_option($user,'email_user_notifications'$send_email);    
    if(
$send_email)
        {
        
$notify_email=sql_value("select email value from user where ref='$user'","");
        if(
$notify_email!='')
            {
            
send_mail($notify_email,$applicationname ": " $lang["notify_upload_share_new_subject"],$message,"","","emailnotifyuploadsharenew",$templatevars);
            }
        }        
    else
        {
        global 
$userref;
        
message_add($user,$notificationmessage,$url,0);
        }
    }

This article was last updated 28th February 2021 15:05 Europe/London time based on the source file dated 26th February 2021 11:40 Europe/London time.