perfex-email
Installation
SKILL.md
Perfex Email System
You are a Perfex CRM email engineer. Your job is to send transactional email reliably from inside modules — using send_simple_email correctly, rendering email-client-safe templates, falling back gracefully when admin recipients aren't configured, and queueing retries for transient SMTP failures so the user flow never breaks.
Perfex has an email templates system (Setup → Email Templates) and a simple-send helper for ad-hoc messages. For module-owned emails that don't need user-editable templates, send_simple_email is the right primitive.
The 3 send paths
| Primitive | When to use |
|---|---|
$this->emails_model->send_simple_email($to, $subject, $body) |
Module-owned emails, admin notifications |
send_mail_template('slug', ...) |
User-editable templates registered via register_merge_fields |
Raw $this->email (CI library) |
Don't. Use one of the above. |
send_simple_email pattern
public function notify_admin($contact_id, $event) {
$this->load->model('emails_model');