SAM Newsletter
A lightweight WordPress plugin that adds a custom Gutenberg “SAM Newsletter” block with AJAX form submission, validation, and a searchable admin dashboard for managing subscribers
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/hassansnexus/sam-newsletter/archive/refs/heads/main.zipSAM Newsletter Plugin
Description: A simple WordPress plugin that provides a newsletter subscription block with AJAX submission and an admin dashboard view.
📋 Features
- Custom Gutenberg block: SAM Newsletter
- AJAX-based subscription (no page reload)
- Client-side and server-side validation
- Prevents duplicate subscriptions
- Stores data in a custom database table
- Admin page for viewing all subscribers
- Optional search/filter in admin
- Clean and minimal design
🛠️ Installation
- Download or clone this repository.
- Place the folder inside your WordPress plugins directory:
- Activate the plugin from WordPress → Plugins → Installed Plugins.
🧩 Usage
- In the WordPress block editor (Gutenberg), search for "SAM Newsletter" block.
- Add it to any page or post.
- View the page and test the form:
- Fill in name and email.
- Submits via AJAX (no reload).
- Displays success or error message instantly.
📊 Admin Page
- Navigate to Dashboard → SAM Newsletter.
- View all newsletter subscribers.
- Use the search box to filter by name or email.
🧱 Database Table
When activated, the plugin creates a table:
| Column | Type | Description |
|---|---|---|
| id | INT | Auto increment primary key |
| name | VARCHAR(100) | Subscriber name |
| VARCHAR(100) | Subscriber email (unique) | |
| created_at | DATETIME | Timestamp of subscription |
When deactivated, the table is removed.
🧰 Technologies Used
- PHP (WordPress Plugin API)
- JavaScript (jQuery, Gutenberg)
- HTML5 + CSS3
- MySQL (via
$wpdb)
🎥 Demo (Loom)
Include your Loom demo link here once recorded:
👉 Demo Video Link
📜 License
This plugin was created for an interview assignment and is free to use for educational purposes.