Changeset 553 for trunk/Modules/EmailQueue/EmailQueue.php
- Timestamp:
- Jul 7, 2013, 11:38:22 PM (11 years ago)
- Location:
- trunk/Modules/EmailQueue
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/EmailQueue/EmailQueue.php
r549 r553 1 1 <?php 2 3 class PageEmailQueueProcess extends Page 4 { 5 var $FullTitle = 'Odeslání pošty z fronty'; 6 var $ShortTitle = 'Fronta pošty'; 7 var $ParentClass = 'PagePortal'; 2 8 3 class EmailQueue extends Module 4 { 9 function Show() 10 { 11 $Output = $this->System->EmailQueue->Process(); 12 $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output; 13 return($Output); 14 } 15 } 16 17 class ModuleEmailQueue extends AppModule 18 { 19 function __construct($System) 20 { 21 parent::__construct($System); 22 $this->Name = 'EmailQueue'; 23 $this->Version = '1.0'; 24 $this->Creator = 'Chronos'; 25 $this->License = 'GNU/GPLv3'; 26 $this->Description = 'Queue for delayed email sending and history'; 27 $this->Dependencies = array('Log'); 28 } 29 30 function Install() 31 { 32 parent::Install(); 33 } 34 35 function UnInstall() 36 { 37 parent::UnInstall(); 38 } 39 40 function Start() 41 { 42 parent::Start(); 43 $this->System->RegisterPage('fronta-posty', 'PageEmailQueueProcess'); 44 $this->System->FormManager->RegisterClass('Email', array( 45 'Title' => 'Nový email', 46 'Table' => 'EmailQueue', 47 'SubmitText' => 'Odeslat', 48 'Items' => array( 49 'Address' => array('Type' => 'String', 'Caption' => 'Adresa', 'Default' => ''), 50 'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''), 51 'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''), 52 ), 53 )); 54 $this->System->FormManager->RegisterClass('EmailQueue', array( 55 'Title' => 'Fronta e-mailů', 56 'Table' => 'EmailQueue', 57 'Items' => array( 58 'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'), 59 'To' => array('Type' => 'String', 'Caption' => 'Příjemce', 'Default' => ''), 60 'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''), 61 'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''), 62 'Headers' => array('Type' => 'String', 'Caption' => 'Hlavička', 'Default' => ''), 63 'Archive' => array('Type' => 'Boolean', 'Caption' => 'Odesláno', 'Default' => '0'), 64 'From' => array('Type' => 'String', 'Caption' => 'Odesílatel', 'Default' => ''), 65 'AttachmentFile' => array('Type' => 'TFile', 'Caption' => 'Příloha', 'Default' => '', 'Null' => true), 66 ), 67 'Actions' => array( 68 array('Caption' => 'Odeslat nové', 'URL' => '/fronta-posty/'), 69 ), 70 )); 71 } 72 73 function Stop() 74 { 75 parent::Stop(); 76 } 77 5 78 function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '') 6 79 { … … 32 105 $Mail->Send(); 33 106 $this->Database->update('EmailQueue', 'Id='.$DbRow['Id'], array('Archive' => 1)); 34 $this-> ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);107 $this->System->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']); 35 108 $Output .= 'To: '.$DbRow['To'].' Subject: '.$DbRow['Subject'].'<br />'; 36 109 } … … 38 111 } 39 112 } 113
Note:
See TracChangeset
for help on using the changeset viewer.