Steps for send e-mails in socialengine: 1.Add the mailtemplate to socialengine database Eg: INSERT INTO `engine4_core_mailtemplates` (`mailtemplate_id`, `type`, `module`, `vars`) VALUES (NULL, ‘event_deleted’, ‘event’, ‘[eventname],[host],[email]’); Default socialengine sendsystem to send mails PHP zend socialengine code: $aEmailTo=array(); $db = $event->getTable()->getAdapter(); $db->beginTransaction(); $select = $event->membership()->getMembersObjectSelect(); $aMembers = $db->fetchAll($select); foreach($aMembers as $aMember) { $aEmailTo[] = $aMember[’email’]; } //event…
Tag: SocialEngine
How to make a csv file in php socialengine
public function downloadcsvAction() { $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $query=Engine_Db_Table::getDefaultAdapter()->select() ->from(‘engine4_users’,array(‘user_id’,’email’,’displayname’,’level_id’,’enabled’,’approved’,’creation_date’)) ->where(‘user_id !=?’,1) ->where(‘user_id not in (?)’, array(‘685′,’870′,’948′,’965′,’1031′,’1249′,’1279′,’1283’)); $aResult= $query->query()->fetchAll(); header(‘Content-Type: application/csv’); header(‘Content-Disposition: attachement; filename=”users.csv”‘); $f = fopen(‘php://output’, ‘w’) or show_error(“Can’t open php://output”); $n = 0;$line = array();$array=array(); $line[]=’Email’; $line[]=’Display Name’; $array[]=$line; $line[]=’info@smarttips.in’;$line[‘sijo’]; $array[] = $line; } foreach ($array as $user) { $n++; if (!fputcsv($f, $user)) { show_error(“Can’t…
Zend getting user profile picture in SocialEngine
Zend getting user profile picture in SocialEngine <?php $smarttipsuser = Engine_Api::_()->user()->getUser($user_id); echo $this->htmlLink($smarttipsuser->getHref(), $this->itemPhoto($member2, ‘thumb.icon’)) ?>
Get the user id of the profile which is being viewed in socialengine
user id of the profile in socialengine $subject=Engine_Api::_()->core()->getSubject(); The above code returns the currently set subject. In profile the subject is the currently viewing profile. So for get id of this profile, use the following code $profileId=$subject->getIdentity();
how to redirect a page in socialengine
redirect function in socialengine we can use this code controller for redirecting <?php /** * Index Controller */ class Admin_IndexController extends Core_Controller_Action { public function loginAction() { $this->_redirect(‘/index’); } redirect is core helper function in socialengine. It can use in socialengine controller.