Email Message configuration for forgot password

2019-09-02 17:40发布

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.

标签: joomla
2条回答
疯言疯语
2楼-- · 2019-09-02 17:55

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);
查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-09-02 18:07

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
查看更多
登录 后发表回答