# Email Override for SendGrid

A WordPress plugin that overrides `wp_mail()` to send all emails through the SendGrid API.

## 🔧 Features

- ✅ Enable or disable SendGrid override
- 🔐 Securely store and use your SendGrid API key
- 📬 Set "From" email and name
- ✉️ Test email function right in the admin settings
- 🎨 Uses native WordPress Settings API and styling
- 📧 Support for HTML emails

## 📦 Installation

1. Upload this plugin to your `/wp-content/plugins/` directory.
2. Activate it from the **Plugins** menu in WordPress.
3. Navigate to **Settings > SendGrid Email**.
4. Fill in your SendGrid API key.
5. Enable the override and click "Save".

## ⚙️ How It Works

The plugin hooks into WordPress' `pre_wp_mail` filter and uses the SendGrid HTTP API to send emails. It replaces the default behavior only when enabled and properly configured.

## 🧪 Test Email

Use the built-in "Send Test Email" button to verify your SendGrid setup is working correctly.

## 📌 Requirements

- WordPress 5.0 or later
- A SendGrid account with an API key

## 🚧 Roadmap

- [ ] Add logging or debug view
- [ ] Add support for attachments
- [ ] Add support for email templates

## 👨‍💻 Author

**Ionut Baldazar**

## 📜 License

GPLv2 or later — [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html)
