当前位置: 首页>>代码示例>>PHP>>正文


PHP UserPeer::getUserFromEmailLocalPart方法代码示例

本文整理汇总了PHP中UserPeer::getUserFromEmailLocalPart方法的典型用法代码示例。如果您正苦于以下问题:PHP UserPeer::getUserFromEmailLocalPart方法的具体用法?PHP UserPeer::getUserFromEmailLocalPart怎么用?PHP UserPeer::getUserFromEmailLocalPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserPeer的用法示例。


在下文中一共展示了UserPeer::getUserFromEmailLocalPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

    protected function execute($arguments = array(), $options = array())
    {
        // initialize the database connection
        $databaseManager = new sfDatabaseManager($this->configuration);
        $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
        $to = $arguments['to'] ? $arguments['to'] : '';
        $message2 = $arguments['message'] ? $arguments['message'] : '';
        // TODO : get login, localparts names
        $subject = "Welcome to JU email System";
        $headers = 'From: Jimma University ICTDO <support@ju.edu.et>';
        $message = <<<EOF
Hello #FIRSTNAME# #FATHERSNAME#,

We would like to inform you about the following.

Your login name for the User Adminitration System is: #LOGIN# 

Please go to http://mail.ju.edu.et/uas/ to use it.  The password to log in
is the same as for the email system.

Login in into the email system is still done with your email address.

Thank you for your cooperation.  We hope you will enjoy the UAS.
Expect us to expand its functionality in the future.

The ICT Development office
EOF;
        $users = array();
        if ($to != '') {
            $a = explode("@", $to);
            $users[] = UserPeer::getUserFromEmailLocalPart($a[0]);
        } else {
            $users = UserPeer::getEmailAccounts();
        }
        if ($message2 != '') {
            $handle = fopen($message2, 'r');
            $Data = fread($handle, filesize($message2));
            fclose($handle);
            //echo $Data;
        } else {
            echo "You must provide file that has text";
        }
        foreach ($users as $user) {
            $login = $user->getLogin();
            $search = array("#LOGIN#", "#FIRSTNAME#", "#FATHERSNAME#", "#EMAILADDRESS#");
            $replace = array($user->getLogin(), $user->getName(), $user->getFathersName(), $user->getEmailAddress());
            echo str_replace($search, $replace, $Data);
            /*if(!mail($user->getEmailAddress(), $subject, str_replace($search, $replace, $Data), $headers))
              {
                   echo "message failed";
              }*/
        }
        //echo $message2;
    }
开发者ID:rgevaert,项目名称:uas,代码行数:54,代码来源:uasSendLoginNamesTask.class.php


注:本文中的UserPeer::getUserFromEmailLocalPart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。