Wednesday, August 22, 2018

How to send custom email using Joomla[Solved]

Hey Guys,

below is the example custom function for sending email using in joomla function
------------------------------------------------------------------
public function sendRegistrationEmail($sender='', $replyTo='', $replyFromName='', $recipient='', $bcc='', $messageSubject='', $messageBody=''){
$mailer = & JFactory::getMailer();
$mailer->setSubject($messageSubject);
$mailer->Encoding = 'base64';
$mailer->setSender($sender);
$mailer->addRecipient($recipient);
$mailer->addReplyTo($replyTo, $replyFromName);
$mailer->isHTML(true);
$mailer->setBody($messageBody);
$mailer->addBCC($bcc);
$mailsent = & $mailer->Send();
$send = ($mailsent)?(true):(false);
return $send;
}

Monday, August 13, 2018

How to set google GA event category wise?

Please follow the below the example for GA event function used in javascript function.


function call in below example for dynamic Event function .


 setGa('Category Name',' level name');
-----------------------------------------------------------


function setGa(catName,value){
var currentPage = jQuery("#page").val(); 
    var blogType = jQuery('#selectType option:selected').val();
var ajaxHitUrl = window.location.protocol + '//' + window.location.hostname + '/';
if(gaMainURL=='blog'){
var gAUrl = ajaxHitUrl+'datacenter/blog?blogType='+blogType+'&shc_page='+shc_page+'&page='+currentPage;
}else{
var gAUrl = ajaxHitUrl+'datacenter/social-hub/podcast?blogType='+blogType+'&shc_page=1&page='+currentPage;
}

ga('send','event',catName,value.toString(),gAUrl.toString());
ga('set', 'page', gAUrl.toString());
ga('send', 'pageview');

}