Hallo @ all, ich würde gerne bei Bestellung - und nur bei Bestellung - diese jeweils als BCC an eine oder mehrere weitere eMail-Adressen mitversenden lassen vom Shop. Leider habe ich in den Einstellungen sowie hier im Forum nicht wirklich brauchbares dazu gefunden. Hat vielleicht jemand eine einfache Lösung dazu? Gruß Ken
[code]<?php class Shopware_Plugins_Frontend_SidOrderMail_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
public function install()
{
$mailhook = $this->createHook( 'sOrder', 'sendMail', 'sendMailNew', Enlight\_Hook\_HookHandler::TypeReplace, 0 ); $this-\>subscribeHook($mailhook); return true; } /\*\* \* send order confirmation mail \* @access public \*/ static function sendMailNew(Enlight\_Hook\_HookArgs $args) { $variables = Enlight()-\>Events()-\>filter('Shopware\_Modules\_Order\_SendMail\_FilterVariables', $args-\>get('variables'), array('subject' =\> $this)); $context = array( 'sOrderDetails' =\> $variables["sOrderDetails"], 'billingaddress' =\> $variables["billingaddress"], 'shippingaddress' =\> $variables["shippingaddress"], 'additional' =\> $variables["additional"], 'sShippingCosts' =\> $variables["sShippingCosts"], 'sAmount' =\> $variables["sAmount"], 'sAmountNet' =\> $variables["sAmountNet"], 'sOrderNumber' =\> $variables["ordernumber"], 'sOrderDay' =\> $variables["sOrderDay"], 'sOrderTime' =\> $variables["sOrderTime"], 'sComment' =\> $variables["sComment"], 'attributes' =\> $variables["attributes"], 'sCurrency' =\> $args-\>getSubject()-\>sSYSTEM-\>sCurrency["currency"], 'sLanguage' =\> $args-\>getSubject()-\>sSYSTEM-\>sLanguageData[$args-\>getSubject()-\>sSYSTEM-\>sLanguage]["isocode"], 'sSubShop' =\> $args-\>getSubject()-\>sSYSTEM-\>sSubShop["id"], 'sEsd' =\> $variables["sEsd"], 'sNet' =\> $args-\>getSubject()-\>sNet, ); // Support for individual paymentmeans with custom-tables if ($variables["additional"]["payment"]["table"]){ $paymentTable = $args-\>getSubject()-\>sSYSTEM-\>sDB\_CONNECTION-\>GetRow(" SELECT \* FROM {$variables["additional"]["payment"]["table"]} WHERE userID=?",array($variables["additional"]["user"]["id"])); $context["sPaymentTable"] = $paymentTable; } else { $context["sPaymentTable"] = array(); } if ($variables["sDispatch"]) { $context['sDispatch'] = $variables["sDispatch"]; } if ($variables['sBookingID']){ $context['sBookingID'] = $variables["sBookingID"]; } $mail = null; if ($event = Enlight\_Application::Instance()-\>Events()-\>notifyUntil( 'Shopware\_Modules\_Order\_SendMail\_Create', array( 'subject' =\> $this, 'context' =\> $context, 'variables' =\> $variables, ) )) { $mail = $event-\>getReturn(); } if (!($mail instanceof \Zend\_Mail)) { $mail = Shopware()-\>TemplateMail()-\>createMail('sORDER', $context); } $mail-\>addTo($args-\>getSubject()-\>sUserData["additional"]["user"]["email"]); if (!$args-\>getSubject()-\>sSYSTEM-\>sCONFIG["sNO\_ORDER\_MAIL"]) { $mail-\>addBcc("mail@domain.tld"); } $mail-\>addBcc("mail2@domain.tld"); $mail-\>FromName = "mail@domain.tld"; // Absender = Mail Shopbetreiber $mail = Enlight()-\>Events()-\>filter('Shopware\_Modules\_Order\_SendMail\_Filter', $mail, array( 'subject' =\> $args-\>getSubject(), 'context' =\> $context, 'variables' =\> $variables, )); if (!($mail instanceof \Zend\_Mail)) { return; } Enlight()-\>Events()-\>notify( 'Shopware\_Modules\_Order\_SendMail\_BeforeSend', array( 'subject' =\> $args-\>getSubject(), 'mail' =\> $mail, 'context' =\> $context, 'variables' =\> $variables, ) ); $shouldSendMail = !(bool)Enlight\_Application::Instance()-\>Events()-\>notifyUntil( 'Shopware\_Modules\_Order\_SendMail\_Send', array( 'subject' =\> $args-\>getSubject(), 'mail' =\> $mail, 'context' =\> $context, 'variables' =\> $variables, ) ); if ($shouldSendMail) { $mail-\>send(); } } } [/code] sollte so klappen, vorher halt noch die [url=mail@domain.tld]mail@domain.tld[/url] austauschen ;)