Cost Calculator Builder
Item PageVideo TutorialsChangelogResources Get Started
  • Cost Calculator Builder Documentation
  • Getting Started
    • Free Version and Pro Version
    • System Requirements
    • Plugin Installation
    • License Activation
      • Upgrading the License
    • Update Billing Details and Access Invoices
    • License Utilization
    • Update The Plugin
    • Templates
    • Feature Request
  • Plugin Features
    • How to Create a Calculator
    • How to Manage Calculators
    • How to Add a Calculator to the Page
    • Calculator Appearance
    • Additional Classes
  • Cost Calculator Settings
    • Calculator Settings
      • Summary Block
      • Currency
      • Warning Texts
      • Confirmation Page
      • Order Form
      • Form Manager
      • Sticky Calculator
      • Woo Products
      • Woo Checkout
      • Payments
      • Webhooks
    • Global Settings
      • Currency (Global)
      • PDF Entries
      • Share Quote Form
      • Order Form (Global)
      • Email Template
      • Backup Settings
      • AI Formula
      • Captcha
      • Payments (Global)
      • Geolocation
  • Calculator Elements
    • General Overview
    • Text
    • Quantity
    • Validated form
    • Dropdown list
    • Image Dropdown (Pro feature)
    • Radio Select
    • Image Radio (Pro feature)
    • Switch Toggle
    • Checkbox
    • Image Checkbox (Pro feature)
    • Date Picker (Pro feature)
    • Time Picker (Pro feature)
    • Basic Slider
    • Multi Range (Pro feature)
    • File Upload (Pro feature)
      • How to Allow Additional File Types in WordPress
      • How to Increase Maximum File Upload Size in WordPress
    • HTML
    • Geolocation (Pro feature)
    • Line
    • Formula
      • AI Assistant (Pro feature)
    • Repeater (Pro feature)
    • Group Field (Pro feature)
    • Page Breaker (Pro feature)
  • Conditional System
    • Introduction
    • How to Create a Condition
    • Condition Options
    • Condition Actions
    • AND/OR Conditions
    • Condition Creating Example
  • Special Plugin Features
    • Orders
    • Discounts
    • Required Fields
    • Contact Form 7 Plugin
  • Payments
    • Settings
    • PayPal
    • Stripe
    • Razorpay
    • Cash Payment
  • Translating Cost Calculator Into a Different Language
    • Translation Basics
    • Translating Static Strings
    • Translating Calculator with WPML
    • FAQ
  • Develeoper's guide
    • Cost Calculator Hooks
      • Order Management
      • Contact Form
      • Confirmation Page
      • Email
  • Troubleshooting
    • Introduction
    • Plugin Conflicts
    • Theme Compatibility
    • Calculator is not loading
    • Cache Settings
    • Email not sending
    • Debug Logs
    • Submit a Support Ticket
  • Changelog
    • Release Notes
    • Changelog (Free Version)
    • Changelog (Pro Version)
  • Pre-built Calculators & Cases
    • Service Booking
    • Graphic Design
    • Loan Interest
    • Delivery Service
    • Renovation Company
    • Dental Services
    • Car Wash Company
    • Medical Services
    • Tuition Fees
    • Printing Services
    • Car Rental
    • Venue Rental Service
  • Advanced Topics
    • License Management
  • Stylemixthemes
    • Cost Calculator Builder WordPress Plugin
    • Themes
    • Plugins
Powered by GitBook
On this page
  • ccb_email_attachment
  • ccb_email_rich_text
  • ccb_email_body_client
  • ccb_email_body_user
  • ccb_email_header
  • ccb_email_footer
  • ccb_email_date
  • ccb_email_logo_style
  • ccb_email_logo_html
  • ccb_email_title

Was this helpful?

  1. Develeoper's guide
  2. Cost Calculator Hooks

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:

add_filter('ccb_email_rich_text', 'disable_rich_text', 20, 2);

function disable_rich_text($description, $calc_id){
	if($calc_id == 257){
		$description = strip_tags($description);
	}
	
	return $description;
}

ccb_email_body_client

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

Parameters:

  • $template(String)

Example:

add_filter('ccb_email_body_client', 'change_email_client_content', 10, 1);

function change_email_client_content($template){
	$template = '
		<html>
		<header>Demo Email Client</header>
		<body>
			<p> Demo email client content </p>	
		</body>
		</html>	
	';	
	return $template;
}

ccb_email_body_user

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

Parameters:

  • $template(String)

Example:

add_filter('ccb_email_body_user', 'change_email_user_content', 10, 1);

function change_email_user_content($template){
	$template = '
		<html>
		<header>Demo Email User Content</header>
		<body>
			<p> Demo email user content </p>	
		</body>
		</html>	
	';	
	return $template;
}

ccb_email_header

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

Parameters:

  • $footer_content(String)

  • $calc_id(Integer)

Example:

add_filter('ccb_email_header', 'change_header_content', 10, 2);
function change_header_content($header, $args){
	if($args['calc_id'] == 257){
		$header = 'From: DemoPage  <vineere@gmail.com>
Content-Type: text/html; charset=UTF-8';		
	}
	return $header;
}

ccb_email_footer

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

function custom_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);
function custom_email_date($email_date, $calc_id){
	if($calc_id == 257){
		$email_date = gmdate("M d Y H:i:s") ."\n";
	}
	return $email_date;
}

ccb_email_logo_style

This is a hook for changing company logo styles.

Parameters:

  • $logo_style(String)

  • $calc_id(Integer)

Example:

add_filter('ccb_email_logo_style', 'custom_email_logo_style', 10, 2);
function custom_email_logo_style($logo_style, $calc_id){
	if($calc_id == 257){
		$logo_style = 'margin:50px; background:green;';
	}
	return $logo_style;
}

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)

add_filter('ccb_email_logo_html', 'custom_email_logo_html', 10, 2);
function custom_email_logo_html($email_logo, $calc_id){
	if($calc_id == 257){
		$email_logo = '<p>This is a demo logo content</p>';
	}
	return $email_logo;
}

ccb_email_title

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

Parameters:

  • $email_title(String)

  • $calc_id(Integer)

add_filter('ccb_email_title', 'custom_email_title', 10, 2);
function custom_email_title($email_title, $calc_id){
	if($calc_id == 257){
		$email_title = 'Custom Email Title';	
	}

	return $email_title;
}
PreviousConfirmation PageNextIntroduction

Last updated 8 months ago

Was this helpful?