<commit_before><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserManager
 *
 * @author mqmtech
 */
namespace Tecnokey\ShopBundle\Service;

use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Tecnokey\ShopBundle\Entity\Shop\User;

class EcommerceMailer {
    
    private $kernel;
    private $mailer;
    
    public function __construct($kernel, $mailer) {
        $this->kernel = $kernel;
        $this->mailer = $mailer;
    }
    
    public function sendEmail($from, $to, $subject, $body){
            $currentEnvironment = $this->getKernel()->getEnvironment();
        
            if(in_array($currentEnvironment, array('dev', 'test'))){
                $this->sendEmailtBySwift($from, $to, $subject, $body);
            }
            else{
                //$this->sendEmailByPHPMail($from, $to, $subject, $body);
                $this->sendEmailByPHPMail($from, '<EMAIL>', $subject, $body);
            }
    }
    
    public function sendEmailtBySwift($from, $to, $subject, $body) {
        
            $message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($from)
            //->setTo("<EMAIL>")
            ->addTo($to)
            ->addTo("<EMAIL>")
            ->setBody($body);<commit_msg>minor changes in email sender in production<commit_after><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserManager
 *
 * @author mqmtech
 */
namespace Tecnokey\ShopBundle\Service;

use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Tecnokey\ShopBundle\Entity\Shop\User;

class EcommerceMailer {
    
    private $kernel;
    private $mailer;
    
    public function __construct($kernel, $mailer) {
        $this->kernel = $kernel;
        $this->mailer = $mailer;
    }
    
    public function sendEmail($from, $to, $subject, $body){
            $currentEnvironment = $this->getKernel()->getEnvironment();
        
            if(in_array($currentEnvironment, array('dev', 'test'))){
                $this->sendEmailtBySwift($from, $to, $subject, $body);
            }
            else{
                $this->sendEmailByPHPMail($from, $to, $subject, $body);
                $this->sendEmailByPHPMail($from, '<EMAIL>', $subject, $body);
            }
    }
    
    public function sendEmailtBySwift($from, $to, $subject, $body) {
        
            $message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($from)
            //->setTo("<EMAIL>")
            ->addTo($to)
            ->addTo("<EMAIL>")
            ->setBody($body);
{'fraction_non_alphanumeric': 0.1440738112136267, 'fraction_numerical': 0.0, 'mean_word_length': 2.3282172373081464, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6883381', 'n_tokens_mistral': 835, 'n_tokens_neox': 827, 'n_words': 165}