1

下面的代码将在电子邮件正文中显示文件名,但我希望它也出现在电子邮件主题中。我将把 $files_list 放在哪里?

我试过了

 'subject'  => __('$files_list uploaded for you','cftp_admin') 
 'subject'  => __($files_list.'New files uploaded for you','cftp_admin'),

不工作。这是代码:

$email_strings_file_by_user = array(
                                'subject'   => __('New files uploaded for you','cftp_admin'),
                                'body'      => __('The following files are now available for you to download.','cftp_admin'),
                                'body2'     => __("If you prefer not to be notified about new files, please go to My Account and deactivate the notifications checkbox.",'cftp_admin'),
                                'body3'     => __('You can access a list of all your files or upload your own','cftp_admin'),
                                'body4'     => __('by logging in here','cftp_admin')
                            );




function email_new_files_for_client($files_list)
{
    global $email_strings_file_by_user;
    $this->email_body = $this->email_prepare_body('new_file_by_user');
    $this->email_body = str_replace(
                                array('%SUBJECT%','%BODY1%','%FILES%','%BODY2%','%BODY3%','%BODY4%','%LINK%'),
                                array(
                                    $email_strings_file_by_user['subject'],
                                    $email_strings_file_by_user['body'],
                                    $files_list,
                                    $email_strings_file_by_user['body2'],
                                    $email_strings_file_by_user['body3'],
                                    $email_strings_file_by_user['body4'],
                                    BASE_URI
                                ),
                                $this->email_body
                            );
    return array(
                'subject' => $email_strings_file_by_user['subject'],
                'body' => $this->email_body
            );
}
4

1 回答 1

0

您的__(.....)函数可能用于语言翻译,因此将变量附加到$files_list翻译中,作为更改:

'subject'  => __($files_list.'New files uploaded for you','cftp_admin'),

'subject'  => $files_list . __('New files uploaded for you','cftp_admin'),
于 2014-10-30T07:40:11.430 回答