PrestaShop 1.5 用のモジュールを開発しています。
私はこのような電子メールを送信しています (ドキュメントが本当に欠落しており、他のデフォルト コンポーネントを調べたところ、これが今のところ得られたものです)
Mail::Send(
$this->context->language->id, //int $id_lang
'template_name',//string $template
//Mail::l('Hello', $this->context->language->id),//string $subject
$this->l('Email subject'),//string $subject
array('{discount}' => $code,
'{firstname}' => $customer['firstname'],
'{lastname}' => $customer['lastname'],
'{img_url}' => $img_url,
'{valid_days}' => $form['days_valid']
),//string $template_vars
$customer['email'],//string $to
implode(' ', array_filter( array( $customer['firstname'], $customer['lastname']) )),
strval( Configuration::get('PS_SHOP_EMAIL') ),//string $from
strval( Configuration::get('PS_SHOP_NAME') ),//string $from_name
/* null,//string $from
null//string $from_name */
null,//array $file_attachment
null,//$mode_smtp
$template_path//string $template_path /*__PS_BASE_URI__.'modules/'.$this->name.'/mails/' */
);
使ってみたメモ
Mail::l('Hello', $this->context->language->id),//string $subject
と
$this->l('Email subject'),//string $subject
メールの件名として。
そして、「...の件名が見つかりませんでした」というメッセージが表示され続けます。お客様が受け取るのは、私がソース コードに入れたハードコードされた文字列です。
このエラーを取り除く方法:
さらに、メールは明らかにランダムな言語 (英語の場合もあればイタリア語の場合もあります) で送信されます。