filter
Allow attachments to be modified (e.g. removed for size reasons) before sending.
Parameters of davo_email_attachments Parameter Type Description $attachments string[] Absolute file paths, already filtered to existing/readable. $to string Recipient address. $log_id int Log row ID.
add_filter Copyadd_filter ( 'davo_email_attachments' , 'my_filter_callback' , 10 , 3 );
/**
* @param string[] $attachments
* @param string $to
* @param int $log_id
*/
function my_filter_callback ( $attachments , $to , $log_id ) {
// Change $attachments as needed, then return it.
return $attachments ;
}src/domains/emails/repository.php:507
filter
Allow global defaults to be overridden or extended.
Parameters of davo_email_global_data Parameter Type Description $defaults array<string, mixed> Default token values.
add_filter Copyadd_filter ( 'davo_email_global_data' , 'my_filter_callback' , 10 , 1 );
/**
* @param array<string, mixed> $defaults
*/
function my_filter_callback ( $defaults ) {
// Change $defaults as needed, then return it.
return $defaults ;
}src/domains/emails/templates.php:398
filter
Allow the HTML body to be modified before sending.
Parameters of davo_email_html_body Parameter Type Description $html string Rendered HTML. $to string Recipient address. $subject string Email subject.
add_filter Copyadd_filter ( 'davo_email_html_body' , 'my_filter_callback' , 10 , 3 );
/**
* @param string $html
* @param string $to
* @param string $subject
*/
function my_filter_callback ( $html , $to , $subject ) {
// Change $html as needed, then return it.
return $html ;
}src/domains/emails/repository.php:490
filter
Control the log retention period in days.
Parameters of davo_email_log_retention_days Parameter Type Description $days int Number of days to retain email logs (default 90).
add_filter Copyadd_filter ( 'davo_email_log_retention_days' , 'my_filter_callback' , 10 , 1 );
/**
* @param int $days
*/
function my_filter_callback ( $days ) {
// Change $days as needed, then return it.
return $days ;
}src/domains/emails/initializer.php:148
filter
Filters the logo URL shown in email headers. Defaults to the site logo.
Parameters of davo_email_logo_url Parameter Type Description $url string Logo URL.
Returns string
add_filter Copyadd_filter ( 'davo_email_logo_url' , 'my_filter_callback' , 10 , 1 );
/**
* @param string $url
*/
function my_filter_callback ( $url ) {
// Change $url as needed, then return it.
return $url ;
}src/domains/emails/templates.php:224
action
Fires after a queue processing batch completes.
Parameters of davo_email_queue_processed Parameter Type Description $processed int Total rows processed. $sent int Successfully sent. $failed int Failed sends.
add_action Copyadd_action ( 'davo_email_queue_processed' , 'my_action_callback' , 10 , 3 );
/**
* @param int $processed
* @param int $sent
* @param int $failed
*/
function my_action_callback ( $processed , $sent , $failed ) {
// Your code here.
}src/domains/emails/repository.php:239
action
Fires when an email is added to the queue.
Parameters of davo_email_queued Parameter Type Description $log_id int Log row ID. $to string Recipient address. $template_slug string Template slug.
add_action Copyadd_action ( 'davo_email_queued' , 'my_action_callback' , 10 , 3 );
/**
* @param int $log_id
* @param string $to
* @param string $template_slug
*/
function my_action_callback ( $log_id , $to , $template_slug ) {
// Your code here.
}src/domains/emails/repository.php:210
filter
Allow third-party code to modify the rendered email parts before delivery.
Parameters of davo_email_rendered Parameter Type Description $resolved array<string, string> { subject, html, text } $slug string Template slug. $data array<string, mixed> Resolved data map.
add_filter Copyadd_filter ( 'davo_email_rendered' , 'my_filter_callback' , 10 , 3 );
/**
* @param array<string, string> $resolved
* @param string $slug
* @param array<string, mixed> $data
*/
function my_filter_callback ( $resolved , $slug , $data ) {
// Change $resolved as needed, then return it.
return $resolved ;
}src/domains/emails/templates.php:122
action
Fires after a retry batch completes.
Parameters of davo_email_retried Parameter Type Description $retried int Total rows retried. $sent int Successfully sent. $failed int Still-failed.
add_action Copyadd_action ( 'davo_email_retried' , 'my_action_callback' , 10 , 3 );
/**
* @param int $retried
* @param int $sent
* @param int $failed
*/
function my_action_callback ( $retried , $sent , $failed ) {
// Your code here.
}src/domains/emails/repository.php:261
action
Fires after an immediate email send attempt.
Parameters of davo_email_sent Parameter Type Description $log_id int Log row ID. $to string Recipient address. $template_slug string Template slug used. $sent bool Whether the send succeeded.
add_action Copyadd_action ( 'davo_email_sent' , 'my_action_callback' , 10 , 4 );
/**
* @param int $log_id
* @param string $to
* @param string $template_slug
* @param bool $sent
*/
function my_action_callback ( $log_id , $to , $template_slug , $sent ) {
// Your code here.
}src/domains/emails/repository.php:135
filter
Filters the support link in email footers. Defaults to the site address followed by /support.
Parameters of davo_email_support_url Parameter Type Description $url string Support page URL.
Returns string
add_filter Copyadd_filter ( 'davo_email_support_url' , 'my_filter_callback' , 10 , 1 );
/**
* @param string $url
*/
function my_filter_callback ( $url ) {
// Change $url as needed, then return it.
return $url ;
}src/domains/emails/templates.php:178
filter
The source has no description for this hook. It is called from Emails_Initializer::initialize().
Passed to callbacks: null$payload
add_filter Copyadd_filter ( 'davo_queue_email' , 'my_filter_callback' , 10 , 2 );
function my_filter_callback ( $arg1 , $arg2 ) {
// Change $arg1 as needed, then return it.
return $arg1 ;
}src/domains/emails/initializer.php:109, and 1 more place
action
Register custom email templates here.
Parameters of davo_register_email_templates Parameter Type Description $templates Emails_Templates The template registry instance. Example: add_action( 'davo_register_email_templates', function( $templates ) { $templates->register( 'my_custom', fn() => [ 'subject' => 'Hello from {{site_name}}', 'html' => '<p>Hi {{username}}!</p>', ] ); } );
add_action Copyadd_action ( 'davo_register_email_templates' , 'my_action_callback' , 10 , 1 );
/**
* @param Emails_Templates $templates
*/
function my_action_callback ( $templates ) {
// Your code here.
}src/domains/emails/initializer.php:263