/** * ПОлучаем список шаблонов для рассылки * @return array */ public function getSubscriptionTemplates() { $obMailTemplates = MailTemplate::where('code', 'LIKE', 'lovata.subscriptions%')->get(); if (empty($obMailTemplates)) { return []; } $arList = []; foreach ($obMailTemplates as $obMailTemplate) { $arList[$obMailTemplate->code] = $obMailTemplate->subject; } return $arList; }
public function getMailGroupInviteTemplateOptions() { switch ($this->comunication_channel) { case self::CHANNEL_EMAIL: return MailTemplate::where('code', 'LIKE', 'dma.friends::%')->orderBy('code')->lists('code', 'code'); break; case self::CHANNEL_TEXT: return []; //MailTemplate::orderBy('code')->lists('code', 'code'); break; case self::CHANNEL_KIOSK: return []; //MailTemplate::orderBy('code')->lists('code', 'code'); break; } }