コード例 #1
0
ファイル: MacrosTest.php プロジェクト: UnionCMS/Core
 /**
  * @return void
  */
 public function testText()
 {
     $macros = new Macros(['name' => 'Sergey', 'age' => 26]);
     $expected = 'Hi, i\'m Sergey and me 26 years';
     $actual = $macros->text('Hi, i\'m {name} and me {age} years');
     $this->assertSame($expected, $actual);
 }
コード例 #2
0
ファイル: Email.php プロジェクト: UnionCMS/Community
 /**
  * Send message for admin when created new user.
  *
  * @return void
  */
 public function adminNewUserMsg()
 {
     $adminMail = Plugin::params('Union/Core')->get('admin_mail', '*****@*****.**');
     $tpl = $this->_params->get('msg_adm_new_registration');
     $msg = $this->_macros->text($tpl);
     $subject = $this->_params->get('msg_adm_new_reg_subject', __d('community', 'Registered a new user'));
     $this->send($subject, $msg, $adminMail);
 }
コード例 #3
0
ファイル: UserMail.php プロジェクト: Cheren/union
 /**
  * Sending notifications to the administrator of the new user registration.
  *
  * @return void
  */
 public function sendAdminMessageNewReg()
 {
     $emailTo = $this->config->get('site_email', '*****@*****.**');
     $message = $this->_community->get('msg_adm_new_registration', null);
     $message = Macros::getInstance($this->_arrayData)->text($message);
     if (isset($this->_entityId) && $message) {
         $subject = __d('community', 'New user registration at the site: {0}', $this->_serverName);
         $this->_send($subject, $message, $emailTo);
     }
 }