Ejemplo n.º 1
0
 public function previewTemplate()
 {
     // get parameters from url route
     $parameters = $this->request->route()->parameters();
     $emailTemplate = EmailTemplate::builder()->find($parameters['template']);
     $response['html'] = $emailTemplate->header_043 . $emailTemplate->body_043 . $emailTemplate->footer_043;
     return view('pulsar::common.views.html_display', $response);
 }
Ejemplo n.º 2
0
 public function editCustomRecord($parameters)
 {
     $parameters['emailAccounts'] = EmailAccount::all();
     $parameters['templates'] = EmailTemplate::all();
     $parameters['themes'] = ComunikLibrary::getThemes();
     $parameters['emlHeaders'] = ComunikLibrary::getEmlHeaders();
     $parameters['groups'] = Group::all();
     $parameters['selectGroups'] = $parameters['object']->getGroups;
     $parameters['countries'] = Contact::getCountriesContacts(['lang' => auth('pulsar')->user()->lang_id_010]);
     $parameters['selectCountries'] = $parameters['object']->getCountries;
     // statistics
     $parameters['queueMailings'] = EmailSendQueue::where('campaign_id_047', $parameters['id'])->count();
     $parameters['sentMailings'] = EmailSendHistory::where('campaign_id_048', $parameters['id'])->count();
     $parameters['noSentMailings'] = EmailSendQueue::where('campaign_id_047', $parameters['id'])->where('status_id_047', 0)->count();
     $parameters['uniqueViewMailings'] = EmailSendHistory::where('campaign_id_048', $parameters['id'])->where('viewed_048', '>', 0)->count();
     $parameters['effectiveness'] = $parameters['uniqueViewMailings'] > 0 ? round($parameters['uniqueViewMailings'] / $parameters['sentMailings'] * 100, 2) : 0;
     return $parameters;
 }