gmail – Send email with a google doc as a pdf attachment Send email with an attachment located in Google Drive

Good day all. My google script worked fine until this week. I’m wanting to attached a google doc to an email as a PDF attachment. My code is as follows…

var pdf_attachment = DriveApp.getFileById(new_certificate_id).getAs("application/pdf");    
GmailApp.sendEmail(email_address, email_subject, email_body, {htmlBody: full_email_body, attachments: pdf_attachment});

Has anything changed with regard to how PDF attachments should be specified? Could this have anything to do with the securuty changes that were implemented this week? Many thanks…