CalcBuilder Forum

Possibility to add a REF#?

User 2017-03-15 22:25:26


Is it possible to add a unique REF#, preferably in the subject of the email, in order to track all the emails for a specific calc quote?

Thank you in advance.

Moonsoft support 2017-03-16 09:59:24

you could add any custom reference at the content of the email, just creating a new result (with a random number, a number based on actual date, getting the number of calculations launched...), and include it same that your other inputs/outputs. At this time the subject doesn't allow to introduce variables, so you would have to introduce a little tweak to the email function in order to get that purpouse. It's located here:


You can search for the email function
function getEnvioWrapper($email,$mail_content,$subject,$attach=null,$cc=null,$bcc=null){

and add any content to the subject, just below this line, for ex, adding REF#: + a random number:

$subject=$subject." REF#:".rand();

Hope this helps, regards

User 2017-03-18 17:42:02


Thanks for your reply.

Instead of having something random, could I get the timestamp? Maybe something like this:

$date = new DateTime();
$subject=$subject." REF#:".$date->getTimestamp();

Thanks in advance.

Moonsoft support 2017-03-20 20:22:21

yes, you can use any valid php code for that purpouse, your example code seems ok. Additionallly you can check the date function official doc in order to find out different formats you can use to print your timestamp here:

Hope this helps, regards

Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!

Create dynamic calculators

Buy now!