For sending email for different types of notification, we have development custom email sending notification and templates. Custom Email notification and custom templates features are available from 2.1.0.
Email Notifications
Email notification can be configured with available placeholders and hooks/actions. Some ready features are available for further customization.
From dashboard email notification can be access from here
From Dashboard left menu->Email SMTP->Email Notifications
Our email notification system is hook based, you can use the available two email notification from any plugin or theme for different actions based on need. Currently we have two email notification in core where one for general user notification and one for admin/site admin notification. Example, you are implementing custom form submission in your email or theme, you can hook our available email notification hook for general user notification and same way for admin notification and you don’t need to think about the template. You can configure all necessary from hook and use the notification template from this smtp plugin. For technical reference email notification base/parent class here.
Available emails notifications:
| Title | Notification for | Core/Pro Addon | Source Code |
|---|---|---|---|
| General notification for user – Sends notification to System User/Guest. | System user or guest user | Core | View Source Code |
| General notification for admin – Sends notification to site admin. | Site Admin | Core | View Source Code |
How to use hook to send email
Site Admin Notification
add_action( 'comfortsmtp_general_email_admin_trigger', [ $this, 'trigger' ], 10, 2 );
add_action( 'comfortsmtp_general_email_admin_trigger', [ $this, 'trigger' ], 10, 2 );
General User Notification
add_action( 'comfortsmtp_general_email_user_trigger', [ $this, 'trigger' ], 10, 2 );
Suppose on a form submit or for an action event we need to send email to admin. This is how we will use the available admin/site admin email sending hook. See below code or this source code.
$user_email = ''; //define if you need to set reply to
$from_name = 'Codeboxr Support';
$from_address = 'noreply@codeboxr.com';
$to = 'info@codeboxr.com';//admin alert
$reply_to = $user_email;
$cc = $bcc = '';
$additional_note = 'Please note that, our time zone is GMT+6 ( i.e. 11 hours ahead from EST time) and we will be responding to you at the next available officer hours based on our time zone.<br/>';
$additional_text = '<div class="text-center-section">
<h2 class="centered-heading">Support Timeline</h2>
<p class="centered-text">
'.wp_kses_post($additional_note).'
</p>
</div>';
$heading = 'Contact Form Notification';
$subject = '[Support Mail from Codeboxr]: '.$subject;
$body = '';// you need to build this part following our static html template. Our example template multiple html section which can you use that compatible for your need. For a form submission we will use something like below
$body = '<div class="form-summary-section">
<h3 class="form-summary-heading">Form Submission Summary</h3>
<p class="message" style="text-align: center; margin-bottom: 25px;">
Thank you for your submission! Here's a summary of the information you provided:
</p>
<table role="presentation" class="form-summary-table" cellpadding="0" cellspacing="0">
<tr>
<td class="form-label" width="35%">Full Name:</td>
<td class="form-value" width="65%">John Doe</td>
</tr>
<tr>
<td class="form-label">Email Address:</td>
<td class="form-value">john.doe@example.com</td>
</tr>
<tr>
<td class="form-label">Phone Number:</td>
<td class="form-value">+1 (555) 123-4567</td>
</tr>
<tr>
<td class="form-label">Company Name:</td>
<td class="form-value">Acme Corporation</td>
</tr>
<tr>
<td class="form-label">Subject:</td>
<td class="form-value">Product Inquiry</td>
</tr>
<tr>
<td class="form-label">Message:</td>
<td class="form-value" style="border-bottom: none;">I am interested in learning more about your products and services. Please contact me at your earliest convenience.</td>
</tr>
</table>
<div class="form-summary-footer">
Submitted on January 30, 2026 at 10:45 AM
</div>
</div>';
$data = [
'to_email' => $to,
'email_body' => $body,
'subject' => $subject,
'from_name' => $from_name,
'from_email' => $from_address,
'reply_to' => $reply_to,
'cc' => $cc,
'bcc' => $bcc,
'additional_content' => ''
];
do_action('comfortsmtp_general_email_admin_trigger', $data, $attachments);
While sending email which email templates will be used is defined from plugin’s setting.
Email Templates
There are two email templates available. Though from the plugin’s code email templates constructed as header, body, footer and styles but we have static email templates available so that developer can see the html markup to setup template in their plugin or theme to use this plugin’s email template and notification features. Email templates can be customized using template override in theme.
The template copy files can be found here
wp-content/plugins/cbxwpemaillogger/templates/emails (core plugin)
There are two different templates available as per below. We will implement more.
| Title | Preview | Static Html Code |
|---|---|---|
| General Template | View Preview | View Source Code |
| Clean Template | View Preview | View Source Code |
Last modified: May 24, 2026