Changeset 689 for trunk/Modules/EmailQueue/EmailQueue.php
- Timestamp:
- Sep 7, 2014, 6:15:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/EmailQueue/EmailQueue.php
r593 r689 6 6 var $ShortTitle = 'Fronta pošty'; 7 7 var $ParentClass = 'PagePortal'; 8 8 9 9 function Show() 10 10 { … … 12 12 $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output; 13 13 return($Output); 14 } 14 } 15 15 } 16 16 17 17 class ModuleEmailQueue extends AppModule 18 18 { … … 37 37 38 38 function DoStart() 39 { 39 { 40 40 $this->System->RegisterPage('fronta-posty', 'PageEmailQueueProcess'); 41 41 $this->System->FormManager->RegisterClass('Email', array( … … 52 52 'Title' => 'Fronta e-mailů', 53 53 'Table' => 'EmailQueue', 54 'DefaultSortColumn' => 'Time', 55 'DefaultSortOrder' => 1, 54 56 'Items' => array( 55 57 'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'), … … 65 67 array('Caption' => 'Odeslat nové', 'URL' => '/fronta-posty/'), 66 68 ), 67 )); 69 )); 68 70 } 69 71 … … 74 76 function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '') 75 77 { 76 $Values = array('To' => $To, 77 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 78 $Values = array('To' => $To, 79 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 78 80 'From' => $From); 79 81 if($AttachmentFileId != '') $Values['AttachmentFile'] = $AttachmentFileId; 80 82 $this->Database->insert('EmailQueue', $Values); 81 83 } 82 84 83 85 function Process() 84 86 { … … 86 88 $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0'); 87 89 while($DbRow = $DbResult->fetch_assoc()) 88 { 90 { 89 91 $Mail = new Mail(); 90 92 $Mail->AddToCombined($DbRow['To']); … … 103 105 $this->System->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']); 104 106 $Output .= 'To: '.$DbRow['To'].' Subject: '.$DbRow['Subject'].'<br />'; 105 } 107 } 106 108 return($Output); 107 109 }
Note:
See TracChangeset
for help on using the changeset viewer.