Skip to content

About

Short Description (GitHub Repository) πŸ“§ Streamline ticket approvals directly from your inbox! Approve, reject, and rate GLPI tickets via secure email links without logging in. Perfect for busy administrators and support teams.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ Approval By Mail for GLPI 11

Streamline ticket approvals directly from your inbox! No login required, secure tokens, instant responses.

License: GPL-3.0+ GLPI 11 PHP 8.2+


🌍 Language / Idioma


✨ Overview

Mail Approve Icon

Mail Approve is a powerful GLPI 11 plugin that transforms ticket workflows by allowing users to approve, reject, and respond to surveys directly from their email inbox. No GLPI login required, no authentication hassles – just secure, one-click actions with cryptographic token validation.

🎯 Perfect For:

  • πŸ“ Ticket Validation Approvals – Approve/reject ticket validations instantly
  • βœ… Solution Acceptance – Accept or reject proposed solutions
  • ⭐ Satisfaction Surveys – Rate ticket solutions with star ratings
  • πŸ”’ Secure Workflows – Token-based authentication with SHA-256 hashing
  • πŸ“± Mobile-Friendly – Beautiful responsive UI for all devices

πŸš€ Features

Feature Description
πŸ” No Login Required Actions are authenticated via secure, single-use cryptographic tokens
πŸ›‘οΈ Enterprise Security Compliant with GLPI 11 security standards, CSRF protection, SHA-256 token hashing
⏱️ Auto-Expiration Tokens expire automatically (configurable, default: 72 hours)
πŸ“± Fully Responsive Perfect rendering on desktop, tablet, and mobile devices
🎨 Customizable UI Rejection forms, star ratings, and styled HTML responses
πŸ“Š Audit Logging Complete audit trail of all token actions and approvals
βš™οΈ Easy Configuration GUI-based plugin settings in GLPI admin panel
🌍 Multi-Language Supports English and Portuguese (pt_BR)

πŸ“¦ Requirements

  • GLPI: 11.0.0 or higher (< 11.99.99)
  • PHP: 8.2 or higher
  • Database: MySQL/MariaDB compatible

πŸ”§ Installation

Step 1: Download & Deploy

# Navigate to your GLPI plugins directory
cd /path/to/glpi/plugins/

# Clone or download mailaprove
git clone https://github.com/celsocaninde/mailaprove.git
# OR
unzip mailaprove.zip

Step 2: Enable in GLPI

  1. Log into GLPI as a Super-Administrator
  2. Navigate to: Setup β†’ Plugins
  3. Locate "Approval By Mail" in the plugin list
  4. Click Install button
  5. Click Enable button
  6. βœ… Ready to go!

βš™οΈ Configuration

After installation, access plugin settings:

Setup β†’ Plugins β†’ Approval By Mail (or click the βš™οΈ gear icon)

Available Options:

  • ⏱️ Token Expiration Time – Set how long tokens remain valid (default: 72 hours)
  • πŸ”„ Token Retention Period – Keep used tokens for audit (default: 30 days)
  • πŸ“‹ Audit Log Retention – Archive audit logs after N days (default: 180 days)
  • βœ… Enable Validations – Turn ticket validation approvals on/off
  • βœ… Enable Solutions – Turn solution acceptance on/off
  • βœ… Enable Satisfaction – Turn satisfaction surveys on/off

πŸ“§ Notification Template Setup

To activate Mail Approve features, add custom tags to your email templates in GLPI.

Step 1: Access Templates

Setup β†’ Notifications β†’ Notification Templates

Step 2: Add Custom Tags

🎯 For Ticket Validation (e.g., "Ticket Validation" template)

<p>To approve this request, click here: 
   <a href="##ticket.validation.accepturl##" style="background: #28a745; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
      βœ… Approve
   </a>
</p>

<p>To reject this request, click here: 
   <a href="##ticket.validation.rejecturl##" style="background: #dc3545; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
      ❌ Reject
   </a>
</p>

βœ… For Solutions (e.g., "Ticket Solution" template)

<p>To accept this solution, click here: 
   <a href="##ticket.solution.accepturl##" style="background: #17a2b8; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
      βœ“ Accept Solution
   </a>
</p>

<p>To reject this solution, click here: 
   <a href="##ticket.solution.rejecturl##" style="background: #ffc107; color: black; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
      βœ— Reject Solution
   </a>
</p>

⭐ For Satisfaction Surveys (e.g., "Ticket Satisfaction" template)

<p>Please rate this ticket solution: 
   <a href="##ticket.satisfaction.url##" style="background: #6f42c1; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px;">
      ⭐ Rate Now
   </a>
</p>

πŸ”’ Security

πŸ›‘οΈ Security Highlights:

  • βœ… SHA-256 Token Hashing – Tokens are hashed in database, never stored in plain text
  • βœ… Single-Use Tokens – Each token can only be used once
  • βœ… Automatic Expiration – Configurable token lifespan prevents abuse
  • βœ… CSRF Protection – Full compliance with GLPI 11 CSRF standards
  • βœ… Audit Logging – Every action is logged with IP, user agent, timestamp
  • βœ… Stateless Paths – Mail endpoints bypass authentication without compromising security

πŸ“Š Audit Trail:

All approvals and rejections are logged with:

  • User identifier
  • IP address
  • User agent (browser/client info)
  • Timestamp
  • Action type and result

πŸ“ Project Structure

mailaprove/
β”œβ”€β”€ README.md                 # This file
β”œβ”€β”€ LICENSE                   # GPLv3+ License
β”œβ”€β”€ composer.json             # PHP dependencies
β”œβ”€β”€ hook.php                  # Plugin lifecycle hooks
β”œβ”€β”€ setup.php                 # Plugin metadata & installation
β”œβ”€β”€ ajax/
β”‚   └── template.preview.php  # Email template preview
β”œβ”€β”€ front/
β”‚   β”œβ”€β”€ approve.php           # Validation approval form
β”‚   β”œβ”€β”€ reject.php            # Validation rejection form
β”‚   β”œβ”€β”€ solution_approve.php  # Solution acceptance
β”‚   β”œβ”€β”€ solution_reject.php   # Solution rejection
β”‚   β”œβ”€β”€ satisfaction.php      # Satisfaction survey
β”‚   β”œβ”€β”€ config.form.php       # Plugin configuration UI
β”‚   └── audit.php             # Audit log viewer
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ AuditLog.php          # Audit logging service
β”‚   β”œβ”€β”€ Config.php            # Configuration management
β”‚   β”œβ”€β”€ NotificationHandler.php # Email tag injector
β”‚   β”œβ”€β”€ PublicAction.php      # Public endpoint handler
β”‚   └── Token.php             # Token generation & validation
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ action_confirm.php    # Confirmation page
β”‚   β”œβ”€β”€ reject_form.php       # Rejection form UI
β”‚   └── satisfaction_form.php # Satisfaction survey UI
└── locales/
    β”œβ”€β”€ en_US.po / en_US.mo   # English translations (source + compiled)
    └── pt_BR.po / pt_BR.mo   # Portuguese (Brazil) translations (source + compiled)

πŸŽ“ Usage Examples

βœ… Example: Approval via Email

  1. User receives email with validation notice
  2. User clicks "Approve" link from inbox
  3. Browser opens secure form (no login required)
  4. Action is recorded in GLPI automatically
  5. Audit log updated with timestamp and IP

⭐ Example: Satisfaction Survey

  1. User receives satisfaction request email
  2. User clicks "Rate Now" link
  3. Beautiful star rating form opens
  4. User submits rating + optional comments
  5. Survey recorded in GLPI + audit trail created

πŸ”„ API Endpoints

Mail Approve exposes public endpoints for email actions:

Endpoint Method Purpose
/plugins/mailaprove/front/approve.php GET/POST Approve ticket validation
/plugins/mailaprove/front/reject.php GET/POST Reject ticket validation
/plugins/mailaprove/front/solution_approve.php GET/POST Accept solution
/plugins/mailaprove/front/solution_reject.php GET/POST Reject solution
/plugins/mailaprove/front/satisfaction.php GET/POST Submit satisfaction rating

Authentication: Token-based (no session required)


πŸ› Troubleshooting

❓ Links don't work in emails

  • βœ… Verify custom tags are added to notification templates
  • βœ… Check token expiration settings in plugin config
  • βœ… Ensure ##ticket.validation.accepturl## tags are used correctly

❓ "Token Expired" error

  • βœ… Default expiration is 72 hours – adjust in plugin settings
  • βœ… Check server time synchronization
  • βœ… Review audit logs for token details

❓ Plugin won't install

  • βœ… Verify PHP version β‰₯ 8.2
  • βœ… Check GLPI version is 11.x
  • βœ… Ensure file permissions: chmod 755 mailaprove
  • βœ… Clear GLPI plugin cache: Setup β†’ Plugins β†’ Reinstall

πŸ“ Localization

Mail Approve supports multiple languages:

  • πŸ‡ΊπŸ‡Έ English (en_US)
  • πŸ‡§πŸ‡· Portuguese - Brazil (pt_BR)

To add more languages, edit .po files in locales/ and contribute!


🀝 Contributing

We welcome contributions! Please feel free to:

  • πŸ› Report bugs via Issues
  • πŸ’‘ Suggest features via Discussions
  • πŸ”§ Submit pull requests for improvements
  • 🌍 Help translate to new languages

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 or later (GPLv3+).

See LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Community-driven development
Built with ❀️ for GLPI administrators and users worldwide.


πŸ™ Acknowledgments

  • GLPI team for the excellent ticket management system
  • Contributors who've submitted fixes and improvements
  • Community for feedback and feature requests

πŸ“ž Support


Made with ❀️ for GLPI | ⭐ If you find this plugin useful, please star this repository!

To reject this solution, click here: Reject Solution

```

For Satisfaction (e.g., "Tickets - Satisfaction survey" template)

<p>Please click here to answer our survey: <a href="##ticket.satisfaction.url##">Answer Survey</a></p>

How it Works under the hood

  • When GLPI generates a notification, the plugin intercepts the data building process (via the ITEM_GET_DATA hook).
  • It generates a cryptographically secure random token and saves its SHA-256 hash in the database.
  • The raw token is appended to the action URL and injected into the email template.
  • When the user clicks the link, they hit a stateless endpoint (e.g., front/approve.php).
  • The endpoint hashes the token from the URL, looks it up in the database, verifies expiration and usage, and processes the action as the authorized user.

Translations

Includes English (en_US) and Brazilian Portuguese (pt_BR) translations. To add more, use Poedit to translate locales/en_US.po and save it as your_lang.po in the locales/ directory, then compile it (msgfmt your_lang.po -o your_lang.mo). GLPI loads the compiled .mo files, so the .mo must be present.

About

Short Description (GitHub Repository) πŸ“§ Streamline ticket approvals directly from your inbox! Approve, reject, and rate GLPI tickets via secure email links without logging in. Perfect for busy administrators and support teams.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages