title: Google App Script generate a clickable link to pdf by my-drive
body: <p>In relation from my post:</p>
  
  <p><a href="https://stackoverflow.com/q/59617795/9519917">Google app script on how to create a pdf from the data received from an html form of its spreadsheet and send the pdf file via email</a></p>
  
  <p>In relation to the function described below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function submitData(form) {
    var subject='New Feedback';
    var body=Utilities.formatString('name: %s &lt;br /&gt;Email: %s&lt;br /&gt;Comment: %s', form.name,form.email,form.comment);
  
    var folderId = "my-folder-ID"; // Please set the folder ID.  // Added
    var blob = Utilities.newBlob(body, MimeType.HTML, form.name).getAs(MimeType.PDF);  // Added
    var file = DriveApp.getFolderById(folderId).createFile(blob);  // Added
  
    var aliases = GmailApp.getAliases()
     Logger.log(aliases); //returns the list of aliases you own
     Logger.log(aliases[0]); //returns the alias located at position 0 of the aliases array
  
    GmailApp.sendEmail('my-email@my-email.com','From an alias', 'A message from an alias!', {'from': aliases[0],subject: subject,htmlBody: body, attachments: [blob]});  // Modified
  
  //  return file.getUrl();  // Modified
    return Utilities.formatString('name: %s &lt;br /&gt;Email: %s&lt;br /&gt;Comment: %s&lt;br /&gt;PDF: %s', form.name,form.email,form.comment,file.getUrl());
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am looking for I'm trying to return in a generic test format of the type "see your PDF file" clickable, instead of the URL address, in the function:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>return Utilities.formatString ('name:% s &lt;br /&gt; Email:% s &lt;br /&gt; Comment:% s &lt;br /&gt; PDF:% s', form.name, form.email, form.comment, file. getUrl ());</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance for the help!</p>