Send emails in socialengine

Send emails in socialengine

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:
$db = $event->getTable()->getAdapter();
$select = $event->membership()->getMembersObjectSelect();
$aMembers = $db->fetchAll($select);

foreach($aMembers as $aMember) {
$aEmailTo[] = $aMember[’email’];
//event delete mail
$filteruserEmailTo = array_filter(array_unique($aEmailTo));
//mail template specified in mail template table
$mailType = “event_deleted”;
$mailParams = array(
‘date’ => date(‘F j, Y, g:i a’),
‘eventname’ => $eventname,
$sentMailConfirmation = Engine_Api::_()->getApi(‘mail’, ‘core’)->sendSystem(


Leave a Reply