Writing a cover letter for each job application can be a lengthy process, especially if you’re applying to multiple positions. Fortunately, there’s a way to streamline this task and save time by automating the creation of personalized cover letters.
This tutorial introduces a simple, free tool that helps you generate tailored cover letters in just a few steps. It’s useful whether you’re applying for internships, your first full-time job, or several positions at once.
How It Works
The tool operates by using a customizable template, where placeholders for the company name and position are automatically replaced with the relevant details. By inputting the company and job title, the tool generates a personalized cover letter that’s ready to use for your application.
Why This Will Save You Time
- No more starting from scratch. Use a basic template that’s personalized in seconds.
- Focus on what matters. You can spend more time polishing your resume or preparing for interviews.
- Perfect for multiple applications. If you’re applying to several companies, you can use the same template and update the details with ease.
How to Use It
Create A Cover Letter Template Using ChatGPT
The first step is to create a template. If you already have one, that’s perfect—just make sure to include the tags {{Position}} and {{CompanyName}} to represent the job title and the company you’re applying to.
If you need a starting point, consider using ChatGPT or any other language model. Simply paste the following prompt into ChatGPT:
I am seeking a position in the [INSERT INDUSTRY NAME] industry. Please generate a professional and tailored cover letter template for me. Ensure the template includes customizable tags: {{Position}} for the job title and {{CompanyName}} for the company name. The cover letter should convey my interest in the role, highlight relevant skills, and express enthusiasm for contributing to the company's success.
NOTE: Feel free to modify the prompt as needed, but leave the last sentence as-is.
Configure The Automation Tool
To use the tool, all you need to do is copy and paste the code below into your Google Apps Script environment. If you’re not familiar with Google Apps Script, don’t worry! It’s just a simple tool built into Google Docs. Follow the steps below:
- Open Google Docs and Create A Blank Document.
- Insert your cover letter into the document.
- Verify that all tags are correct.
- Rename Your Document (i.e. Cover Letter – Template)
- Go to Extensions > Apps Script.
- Delete any code in the editor and paste in the code below.
- The Default File will be Codes.gs. It is okay to leave this as-is. In the right pane, delete all existing code. It may look something like this:
- The Default File will be Codes.gs. It is okay to leave this as-is. In the right pane, delete all existing code. It may look something like this:
- Click Save (disk button) and name your project (something like “Cover Letter Automator”).
- Close the Apps Script editor.
- Go to File > Make A Copy > Make A copy
- Now, you’ll see a new menu option in Google Docs called Automate.
- Click on it and select Create Cover Letter.
- Enter the company name and position when prompted, separated by a comma, and voila! A new, personalized cover letter will be created for you.
Here’s the Code
// Cover Letter Automation Tool
// Created by Sage N Clements, CISSP
// Website: www.sageknowsit.com
// Youtube: www.youtube.com/@SageTheProfessor/
// Feel free to use and modify, but please credit by linking to the above site or Youtube Channel!
// -------------------------------------
function createCoverLetter(companyName, position) {
var templateFile = getMostRecentTemplate();
if (!templateFile) {
Logger.log('No template found!');
return;
}
var templateDoc = DocumentApp.openById(templateFile.getId());
var body = templateDoc.getBody();
body.replaceText('{{CompanyName}}', companyName);
body.replaceText('{{Position}}', position);
var newDoc = DocumentApp.create('Cover Letter for ' + companyName);
var newBody = newDoc.getBody();
newBody.setText(body.getText());
Logger.log('New document created: ' + newDoc.getUrl());
}
function getMostRecentTemplate() {
var files = DriveApp.getFilesByName('Copy of [Your Template Name]');
var recentFile = null;
while (files.hasNext()) {
var file = files.next();
if (!recentFile || file.getDateCreated() > recentFile.getDateCreated()) {
recentFile = file;
}
}
return recentFile;
}
function showPrompt() {
var ui = DocumentApp.getUi();
var response = ui.prompt('Enter the company name and position (comma-separated)', ui.ButtonSet.OK_CANCEL);
if (response.getSelectedButton() == ui.Button.OK) {
var text = response.getResponseText();
var parts = text.split(',');
if (parts.length == 2) {
var companyName = parts[0].trim();
var position = parts[1].trim();
createCoverLetter(companyName, position);
} else {
ui.alert('Please enter both the company name and position, separated by a comma.');
}
}
}
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Automate')
.addItem('Create Cover Letter', 'showPrompt')
.addToUi();
}
Helpful Tips
- Make sure you have a template saved in your Google Drive with placeholders like
{{CompanyName}}
and{{Position}}
. - In the code above, replace
'Copy of [Your Template Name]'
with the exact name of your template file. For example, if your template is named “My Cover Letter Template,” change the line in the code to:var files = DriveApp.getFilesByName('Copy of My Cover Letter Template');
This ensures that the script finds your file when generating the new cover letter. You can customize the template as much as you want!
Enjoy the Tool? Consider Donating!
If you find this tool helpful and would like to support my work, consider making a donation. Your support allows me to create more free tools like this to help people like you save time and effort.
Donate Here (Link to your donation platform, e.g., PayPal, Patreon)
Thank you for your generosity!