/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (Resource::where('id_007', 'admin-attachment-mime')->count() == 0 && Package::where('id_012', 2)->count() == 1) {
         Resource::create(['id_007' => 'admin-attachment-mime', 'name_007' => 'Attachments - Attachment Mime', 'package_id_007' => '2']);
     }
 }
 public function updateCustomRecord($parameters)
 {
     Package::where('id_012', $parameters['id'])->update(['name_012' => $this->request->input('name'), 'folder_012' => $this->request->input('folder'), 'active_012' => $this->request->input('active', 0), 'sorting_012' => $this->request->input('sorting')]);
     // update object packages from session
     session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
 }
Exemple #3
0
 /**
  *  Patterns function to replace their values
  *
  * @access	public
  * @param   array   $data
  * @param   string  $index
  * @return  array
  */
 private static function replaceWildcard($data, $index)
 {
     $comunikPackage = Package::where('folder', 'comunik')->first();
     // check if comunik package is publish
     if (!is_null($comunikPackage) && $comunikPackage->active_012) {
         $data[$index] = str_replace("#link#", route('previewComunikEmailCampaign', ['campaign' => '#campaign#', 'historyId' => '#historyId#']), $data[$index]);
         $data[$index] = str_replace("#unsubscribe#", route('getUnsubscribeComunikContact', ['contactKey' => '#contactKey#']), $data[$index]);
         $data[$index] = str_replace("#pixel#", url(config('pulsar.name')) . config('comunik.trackPixel'), $data[$index]);
     }
     // Message body
     if (isset($data['contactKey'])) {
         $data[$index] = str_replace("#contactKey#", $data['contactKey'], $data[$index]);
     }
     // Contact coded ID, to track (comunik)
     if (isset($data['company'])) {
         $data[$index] = str_replace("#company#", $data['company'], $data[$index]);
     }
     // Company name (comunik)
     if (isset($data['name'])) {
         $data[$index] = str_replace("#name#", $data['name'], $data[$index]);
     }
     // Contact name (comunik)
     if (isset($data['surname'])) {
         $data[$index] = str_replace("#surname#", $data['surname'], $data[$index]);
     }
     // Contact surname (comunik)
     if (isset($data['birthDate'])) {
         $data[$index] = str_replace("#birthDate#", $data['birthDate'], $data[$index]);
     }
     // birth date (comunik)
     if (isset($data['email'])) {
         $data[$index] = str_replace("#email#", $data['email'], $data[$index]);
     }
     // Contact email (comunik)
     if (isset($data['campaign'])) {
         $data[$index] = str_replace("#campaign#", $data['campaign'], $data[$index]);
     }
     // Campaign coded ID, to track (comunik)
     if (isset($data['historyId'])) {
         $data[$index] = str_replace("#historyId#", $data['historyId'], $data[$index]);
     }
     // Sending coded ID, to track (comunik)
     $data[$index] = str_replace("#date#", date(config('pulsar.datePattern')), $data[$index]);
     // Current date
     // function designed to replace the word #subject# in the title of HTML templates
     if (isset($data['subject'])) {
         $data[$index] = str_replace("#subject#", $data['subject'], $data[$index]);
     }
     return $data;
 }