These hooks let developers customize Email in the Cost Calculator.
ccb_email_attachment
This is a hook to add existing files inside WP.
Parameters:
$attachments(Array)
$calc_id(Integer)
Example:
add_filter('ccb_email_attachment','add_attachment',10,2);functionadd_attachment($attachments, $params){if ( $params['calcId'] ==257) { //change 257 to the ID of your calculator $attachments[] = ABSPATH .'wp-content/uploads/2023/10/filename.pptx'; //set the ABSOLUTE path to the file here }return $attachments; }
ccb_email_rich_text
This hook allows you to turn off rich text format in summary, as well as customize the text itself.
This hook allows you to change the footer of the email.
Parameters:
$footer_content(String)
$calc_id(Integer)
Example:
add_filter('ccb_email_footer','custom_footer_function',10,2);functioncustom_footer_function($footer_content, $calc_id){if($calc_id ==257){ $footer_content ='<p>This is a demo footer content</p>'; }return $footer_content;}
ccb_email_date
This is a hook that changes the date of sending the email or allows to change the format of the date of sending the email.
Parameters:
$email_date(String)
$calc_id(Integer)
Example:
add_filter('ccb_email_date','custom_email_date',10,2);functioncustom_email_date($email_date, $calc_id){if($calc_id ==257){ $email_date =gmdate("M d Y H:i:s")."\n"; }return $email_date;}
This is a hook to add custom HTML code to the company logo block.
Parameters:
$email_logo(String)
$calc_id(Integer)
add_filter('ccb_email_logo_html','custom_email_logo_html',10,2);functioncustom_email_logo_html($email_logo, $calc_id){if($calc_id ==257){ $email_logo ='<p>This is a demo logo content</p>'; }return $email_logo;}