Sending out emails as a part of a Google Workspace automated workflow is a very common task. In Google Apps Script we can send emails to users using the MailApp.sendEmail(), the GmailApp.sendEmail() method or even as a JSON payload with the Gmail Advanced API service.
While one might expect that the sender’s signature block would also be transmitted with the automated email, we find that this is not in fact the case.
Scott Donald highlights some of the pitfalls of trying to access the Gmail signatures using Google Apps Script. Fortunately Scott also shares a workaround for using a Gmail draft to store a number of signatures/snippets. This is all wrapped in a handy getSignatureBlock()
function, created and shared by Scott to get either the user’s primary signature block or one stored in a draft.
Source: Add the User’s Signature Block to an Automated Gmail Email with Apps Script – Yagisanatode
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.