如何在Joomla 2.5中编辑用户激活邮件正文?

时间:2015-01-24 08:01:23

标签: joomla joomla2.5 joomla3.0 joomla-extensions

我正在使用Joomla 2.5用户注册表。注册成功后,用户将获得激活链接投掷他们的注册邮箱ID。我想将一些内容添加到电子邮件正文(页脚)。我已经尝试了很多但没有成功。

代码:registration.php

if ($useractivation == 2)
    {
        // Set the link to confirm the user email.
        $uri = JURI::getInstance();
        $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
        $data['activate'] = $base.JRoute::_('index.php?option=com_users&task=registration.activate&token='.$data['activation'], false);

        $emailSubject   = JText::sprintf(
            'COM_USERS_EMAIL_ACCOUNT_DETAILS',
            $data['name'],
            $data['sitename']
        );

        if ($sendpassword)
        {
            $emailBody = JText::sprintf(
                'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY',
                $data['name'],
                $data['sitename'],
                $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],
                $data['siteurl'],
                $data['username'],
                $data['password_clear']
            );
        }
        else
        {    $footer1 = "regarts: neuroturma ";
            $emailBody = JText::sprintf(
                'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW',
                $data['name'],
                $data['sitename'],
                $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],
                $data['siteurl'],
                $data['username'],
                $footer1,//not works
                'regarts: neuroturma'//not works
            );
        }
    }
    elseif ($useractivation == 1)
    {
        // Set the link to activate the user account.
        $uri = JURI::getInstance();
        $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
        $data['activate'] = $base.JRoute::_('index.php?option=com_users&task=registration.activate&token='.$data['activation'], false);

        $emailSubject   = JText::sprintf(
            'COM_USERS_EMAIL_ACCOUNT_DETAILS',
            $data['name'],
            $data['sitename']
        );

        if ($sendpassword)
        {
            $emailBody = JText::sprintf(
                'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY',
                $data['name'],
                $data['sitename'],
                $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],
                $data['siteurl'],
                $data['username'],
                $data['password_clear']
            );
        }
        else
        {
            $emailBody = JText::sprintf(
                'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW',
                $data['name'],
                $data['sitename'],
                $data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],
                $data['siteurl'],
                $data['username']
            );
        }
    }
    else
    {

        $emailSubject   = JText::sprintf(
            'COM_USERS_EMAIL_ACCOUNT_DETAILS',
            $data['name'],
            $data['sitename']
        );

        $emailBody = JText::sprintf(
            'COM_USERS_EMAIL_REGISTERED_BODY',
            $data['name'],
            $data['sitename'],
            $data['siteurl']
        );
    }

    // Send the registration email.
    $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);

我应该在哪里添加我的页脚内容?请帮我。

1 个答案:

答案 0 :(得分:0)

尝试编辑 /language/en-GB/en-GB.com_user.ini

此链接也可以提供很多帮助 http://forum.joomla.org/viewtopic.php?f=706&t=871489 http://forum.joomla.org/viewtopic.php?f=624&t=852596