Email

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);

function add_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.

Parameters:

  • $description(String)

  • $calc_id(Integer)

Example:

ccb_email_body_client

This is a hook for changing the content of the email for clients.

Parameters:

  • $template(String)

Example:

ccb_email_body_user

This is a hook to change the content of the email for users.

Parameters:

  • $template(String)

Example:

ccb_email_header

This hook allows you to change the header of the message.

Parameters:

  • $footer_content(String)

  • $calc_id(Integer)

Example:

This hook allows you to change the footer of the email.

Parameters:

  • $footer_content(String)

  • $calc_id(Integer)

Example:

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:

ccb_email_logo_style

This is a hook for changing company logo styles.

Parameters:

  • $logo_style(String)

  • $calc_id(Integer)

Example:

ccb_email_logo_html

This is a hook to add custom HTML code to the company logo block.

Parameters:

  • $email_logo(String)

  • $calc_id(Integer)

ccb_email_title

This is a hook to change the title of the email.

Parameters:

  • $email_title(String)

  • $calc_id(Integer)

Last updated

Was this helpful?