2014-10-30 34 views
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 
      ); 
} 
+0

谢谢回复,是的,它是PHP – 2014-10-30 07:30:20

回答

0

__(.....)功能可能是用于语言翻译,所以追加变量$files_list与翻译,为改变:

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

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