私はそれがうまくいかないことを知っていますが、私はsend sales関数に$ salesDataと$ salesData2をどう適合させることができますか?電子メールの関数と引数を送信する - Zendエラー "Subject set twice"
$salesData['email'] = Mage::getStoreConfig('trans_email/ident_custom3/email');
$salesData['name'] = Mage::getStoreConfig('trans_email/ident_custom3/name');
$salesData2['email'] = Mage::getStoreConfig('trans_email/ident_custom4/email');
$salesData2['name'] = Mage::getStoreConfig('trans_email/ident_custom4/name');
こういうことをする方法はありますか?
$emailTemplate->send($salesData && $salesData2, $product->getStoreId(), $emailTemplateVariables);
私の脳は今日働いていないようです。上記は機能しません。
は、私はまた、foreachのようにのように試してみた:
$emails = (Mage::getStoreConfig('trans_email/ident_custom4/email')) && (Mage::getStoreConfig('trans_email/ident_custom3/email'));
foreach ($emails as $email) $emailTemplate->send($email, $product->getStoreId(), $emailTemplateVariables);
詳しい方法:
private function _sendStatusMail($product)
{
$emailTemplate = Mage::getModel('core/email_template');
$emailTemplate->loadDefault('elic_productnotification_tpl');
$emailTemplate->setTemplateSubject('Product has been disabled');
$salesData['email'] = Mage::getStoreConfig('trans_email/ident_custom3/email');
$salesData['name'] = Mage::getStoreConfig('trans_email/ident_custom3/name');
$salesData2['email'] = Mage::getStoreConfig('trans_email/ident_custom4/email');
$salesData2['name'] = Mage::getStoreConfig('trans_email/ident_custom4/name');
$emailTemplate->setSenderName($salesData['name']);
$emailTemplate->setSenderEmail($salesData['email']);
$emailTemplate->setSenderName($salesData2['name']);
$emailTemplate->setSenderEmail($salesData2['email']);
$emailTemplateVariables['style_number'] = $product->getElicStyle();
$emailTemplateVariables['frame_color'] = $product->getAttributeText('frame_color');
$emailTemplateVariables['size'] = $product->getAttributeText('size');
$emailTemplateVariables['elic_color'] = $product->getAttributeText('elic_color');
$emailTemplateVariables['store_name'] = Mage::getModel('core/store')->load($product->getStoreId())->getName();
$emailTemplateVariables['product_name'] = Mage::getModel('catalog/product')->load($product->getId())->getName();
$emailTemplateVariables['product_sku'] = $product->getSku();
$emailTemplateVariables['dates'] = date("F jS Y h:i:sA", strtotime('-7 hours'));
$email = (Mage::getStoreConfig('trans_email/ident_custom3/email'));
foreach ($emails as $email) $emailTemplate->send($email, $product->getStoreId(), $emailTemplateVariables);
}
本当に?これは私が探しているものかもしれませんし、私はそれを知っているべきです...それは論理的です。本当に素早く試してみましょう。 – thismethod
私はエラーが発生しました:警告:無効な引数がforeach()のために提供されました – thismethod