SmartDraft is an AI-powered Chrome extension designed to help users draft, refine, and send emails effortlessly. By leveraging advanced AI models, SmartDraft generates complete email drafts based on user input, adjusts the tone to meet specific needs, and integrates seamlessly with Gmail for quick sending.
- AI-Powered Email Drafting: Automatically generates email drafts based on the input topic and selected tone (formal, casual, friendly).
- Refine Drafts: Allows users to refine the generated drafts to better suit their needs with a single click.
- Gmail Integration: Opens the draft directly in Gmail, using the first line as the subject and the rest as the body.
- Copy to Clipboard: Quickly copy the generated email content to paste into any other platform or document.
- User-Friendly Interface: Simple and intuitive UI designed for seamless interaction and productivity.
-
Clone or Download this repository to your local machine:
git clone https://github.com/your-username/smartdraft.git
-
Navigate to the cloned folder:
cd smartdraft -
Load the Extension into Chrome:
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer Mode using the toggle at the top right.
- Click Load unpacked and select the directory where the SmartDraft project is located.
- Open Chrome and navigate to
-
Obtain an API Key from OpenAI:
- Visit OpenAI's API and create an account if you don't have one.
- Navigate to the API section and generate a new API key.
- Copy the generated API key for use in the next step.
-
Update the API Key in the
popup.jsfile:- Open
popup.jsin the SmartDraft folder. - Replace
YOUR_API_KEYwith your OpenAI API key:const apiKey = 'sk-your-api-key';
- Open
-
Reload the Extension in Chrome:
- Go back to
chrome://extensions/. - Click Reload next to the SmartDraft extension to apply your changes.
- Go back to
-
Open the SmartDraft Extension:
- Click on the SmartDraft icon in the Chrome toolbar.
-
Enter Email Topic:
- Input the subject or topic of your email in the provided text area.
-
Select Tone:
- Choose the desired tone for the email:
formal,casual, orfriendly.
- Choose the desired tone for the email:
-
Generate & Refine:
- Click Generate Draft to create an AI-generated email draft.
- Click Refine Email to adjust the content as needed.
-
Send or Copy:
- Click Send via Gmail to open the draft in Gmail with the subject and body pre-filled.
- Click the copy icon to copy the generated draft to your clipboard.
- JavaScript: Core logic and interaction with the OpenAI API.
- OpenAI API: Powers the AI model for generating and refining email drafts.
- HTML & CSS: UI design and layout for the Chrome extension popup.
- Chrome Extension API: Integrates SmartDraft directly into the Chrome browser for easy access.