Email Message configuration for forgot password

泄露秘密 提交于 2019-12-13 02:44:37

问题


I am using joomla's default login module. In forgot module section, I have added one more column called username. Now how shall I send this username along with the token id in the mail? Please help me.

Thanks in advance.


回答1:


Open the following folder:

root/components/com_user/models/reset.php

Joomla 2.5

Lines 383 to 388, change this:

$body = JText::sprintf(
    'COM_USERS_EMAIL_PASSWORD_RESET_BODY',
    $data['sitename'],
    $data['token'],
    $data['link_text']
);

to this:

$body = JText::sprintf(
    'COM_USERS_EMAIL_PASSWORD_RESET_BODY',
    $data['fromname'], //added data type to get the username
    $data['sitename'],
    $data['token'],
    $data['link_text']
);

Joomla 1.5

On line 256, change this:

$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url);

to this:

$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $fromname, $token, $url);



回答2:


This is incorrect;

$data['fromname'], //added data type to get the username

This should read ;

$data['**username**'], //added data type to get the username

Also dont forget you will also need to modify the language string for this email to include and extra %s.

So in you email it will now read;

%$ = username
%$ = sitename
%$ = verification code
%$ = site link


来源:https://stackoverflow.com/questions/13232811/email-message-configuration-for-forgot-password

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!