Triggered email with attached dokument uploaded by the user

Hi

I’m working in the recruitment business.
FOR NOW:
Whenever a user is filling out a form on the apply for job section, the contactperson on that specific job ad gets an email with all the information from the applicant using triggered emails.
HOWEVER … I can’t get it to attach the pdf file the applicant is uploading with their resumé.

Is it even possible to do? if so, can anyone please help :slight_smile:

I get an error: “andre and cv is not of type string”
in the dataset they are dokuments

import wixUsers from ‘wix-users’ ;

$w . onReady ( function () {

$w ( '#applyJob' ). collapse () 
    . then  ( () => { 
        console . log ( "done!" ); 

}); 

$w ( '#button1' ). onClick ( () => { 
    **if** (  $w ( "#applyJob" ). collapsed  ) { 
        $w ( "#applyJob" ). expand (); 
    } 
    **else**  { 
    $w ( "#applyJob" ). collapse (); 
    } 
}); 
    $w ( '#dynamicDataset' ). onReady ( () => { 
        **let**  jobTitle  =  $w ( '#dynamicDataset' ). getCurrentItem (). title ; 
        **let**  kontaktTlf  =  $w ( '#dynamicDataset' ). getCurrentItem (). kontaktTelefon ; 
        console . log  ( kontaktTlf ); 
            **if**  ( kontaktTlf  ==  <contact number> ){ 
                **let**  userID  =  //UserID for contactperson on the jobad 
               
            } 
            **else if**  ( kontaktTlf  ==  <contact number> ){ 
                **let**  userID  =  //UserID for contactperson on the jobad 
               
            } 
            **else if**  ( kontaktTlf  ==  <contact number> ){ 
                **let**  userID  =  //UserID for contactperson on the jobad 
 
            } 
            **else if**  ( kontaktTlf  ==  <contact number> ){ 
                **let**  userID  =  //UserID for contactperson on the jobad 
                
            } 
            **else if**  ( kontaktTlf  ==  <contact number> ){ 
                **let**  userID  =  //UserID for contactperson on the jobad 
                
            **else**  { 
                console . log ( "Can't find contactnumber!" ) 
            } 

        **const**  tempUserID  =  //My user ID for testing 
        wixUsers . emailUser ( "Jobbank" ,  tempUserID , { 
            variables : { 
                title :  jobTitle , 
                fornavn :  $w ( "#fornavn" ). value , 
                efternavn :  $w ( "#efternavn" ). value , 
                telefon :  $w ( "#telefon" ). value , 
                andre :  $w ( "#andre" ). value , 
                cv :  $w ( "#cv" ). value , 
                motiveret :  $w ( "#motiveret" ). value 
            }        
        }); 
        
    }); 

});

I’ve tried this before, unfortunately I couldn’t find a way to attach a document to a triggered mail. I also tried to include the link to the document rather than attaching the document itself, but I’m only getting the internal wix URL, which doesn’t help a ton.

I hope someone else has found a good way to do it, but there might just not be any way to do it.