classes/XLite/Module/XCExample/EmailDemo/Core/Mailer.php 0000666 00000001350 13301303435 0016745 0 ustar 00 $body, 'subject' => 'Demo notification' ]); $templatesDir = 'modules/XCExample/EmailDemo/message'; static::compose( 'DemoMail', static::getSiteAdministratorMail(), $to, $templatesDir, array(), true, \XLite::CUSTOMER_INTERFACE ); return static::getMailer()->getLastError(); } } classes/XLite/Module/XCExample/EmailDemo/Main.php 0000666 00000001625 13301303435 0015535 0 ustar 00 to, $request->body ); if (!is_null($error)) { \XLite\Core\TopMessage::getInstance()->addError('Error of test e-mail sending: ' . $error); } else { \XLite\Core\TopMessage::getInstance()->add('Test e-mail has been successfully sent'); } $this->setReturnURL( $this->buildURL('example_email_demo', '', array()) ); } } classes/XLite/Module/XCExample/EmailDemo/View/Page/Admin/ExampleEmailDemo.php 0000666 00000001436 13301303435 0022637 0 ustar 00 [ self::SCHEMA_CLASS => 'XLite\View\FormField\Input\Text\Email', self::SCHEMA_LABEL => 'Email to', self::SCHEMA_REQUIRED => true, ], 'body' => [ self::SCHEMA_CLASS => 'XLite\View\FormField\Input\Text', self::SCHEMA_LABEL => 'Body', self::SCHEMA_REQUIRED => false, ], ]; protected function getDefaultModelObject() { return null; } protected function getFormClass() { return 'XLite\Module\XCExample\EmailDemo\View\Form\EmailDemo'; } } classes/XLite/Module/XCExample/EmailDemo/install.yaml 0000666 00000000741 13301303435 0016470 0 ustar 00 XLite\Model\Notification: - templatesDirectory: modules/XCExample/EmailDemo/message availableForAdmin: false availableForCustomer: true enabledForAdmin: false enabledForCustomer: true translations: - code: en name: Demo notification (Email Demo module) description: This notification is sent from testing page admin.php?target=example_email_demo customerSubject: Demo notification customerText: Body of demo notification skins/admin/modules/XCExample/EmailDemo/page/example_email_demo/body.twig 0000666 00000000201 13301303435 0022460 0 ustar 00 {## # body.twig #}
Text: {{ this.body }}