Sends e-mails on registration event
@param array $data
489418
public function emailRegistration(array $data)
    {
        if ($this->config->get('user_registration_email_customer', true)) {
            $this->mail->set('user_registered_customer', array($data));
        }

        if ($this->config->get('user_registration_email_admin', true)) {
            $this->mail->set('user_registered_admin', array($data));
        }
    }
684446
public function data($data)
    {
        if ($this->_rcpt == false) {
            throw new SMTPException(__('Must call RCPT before calling DATA'));
        }

        $this->_send('DATA');
        $this->_expect(354, 120);

        foreach ($this->_header_fields as $name => $body) {
            // Every header can contain an array. Will insert multiple header fields of that type with the contents of array.
            // Useful for multiple recipients, for instance.
            if (!is_array($body)) {
                $body = array($body);
            }

            foreach ($body as $val) {
                $this->_send($name . ': ' . $val);
            }
        }
        // Send an empty newline. Solves bugs with Apple Mail
        $this->_send('');

        // Because the message can contain \n as a newline, replace all \r\n with \n and explode on \n.
        // The send() function will use the proper line ending (\r\n).
        $data = str_replace("\r\n", "\n", $data);
        $data_arr = explode("\n", $data);

        foreach ($data_arr as $line) {
            // Escape line if first character is a period (dot). http://tools.ietf.org/html/rfc2821#section-4.5.2
            if (strpos($line, '.') === 0) {
                $line = '.' . $line;
            }
            $this->_send($line);
        }

        $this->_send('.');
        $this->_expect(250, 600);
        $this->_data = true;
    }
427723
public function initialize(array $data = array())
    {
        if($this->exe->flash->has('form_data'))
            $this->set($this->exe->flash->get('form_data'));

        parent::initialize($data);
    }
1256381
protected function _sendData($email)
    {
        $this->_smtpSend('DATA', '354');

        $headers = $this->_headersToString($this->_prepareMessageHeaders($email));
        $message = $this->_prepareMessage($email);

        $this->_smtpSend($headers . "\r\n\r\n" . $message . "\r\n\r\n\r\n.");
        $this->_content = ['headers' => $headers, 'message' => $message];
    }
931120
public function notify($event, array $data = [])
    {
        $event = (string) $event;

        if (($pos = strpos($event, '.')) == false) {
            throw new \InvalidArgumentException('The event name is invalid (expecting "action.event")');
        }

        $action = substr($event, 0, $pos);

        if (!isset($this->responders[$action])) {
            return;
        }

        if (isset($this->data[$action])) {
            $data = array_merge($this->data[$action], $data);
        }

        foreach ($this->responders[$action] as $responder) {
            if ($responder instanceof ResponderInterface) {
                $responder->respond($event, $data);
            } elseif (is_callable($responder)) {
                $responder($event, $data);
            }
        }
    }
1044357
public function exchangeArray(array $data)
	{
		$this->setActivityId(isset($data['ActivityId']) ? $data['ActivityId'] : null);
		$this->setProjectId(isset($data['ProjectId']) ? $data['ProjectId'] : null);
		$this->setName(isset($data['Name']) ? $data['Name'] : null);
		$this->setDescription(isset($data['Description']) ? $data['Description'] : null);
		$this->setTags(isset($data['Tags']) ? $data['Tags'] : null);
		$this->setStarted(isset($data['Started']) ? $data['Started'] : null);
		$this->setStopped(isset($data['Stopped']) ? $data['Stopped'] : null);

		if (array_key_exists('Project.ProjectId', $data)) {
			$this->project = new ProjectEntity(array(
				'ProjectId' => $data['Project.ProjectId'],
				'Name' => $data['Project.Name'],
				'Description' => $data['Project.Description'],
				'Created' => $data['Project.Created']
			));
		}
	}
582969
public function sendData($data)
    {
        $this->verifySignature();

        if ($this->params->has('notify_id')) {
            if ($this->verifyNotifyId) {
                $this->verifyNotifyId();
            }
        }

        return $this->response = new AopNotifyResponse($this, $data);
    }
335001
public function sendData($data)
    {
        $response = $this->gocardless->events()->get($this->getEventId());

        return $this->response = new EventResponse($this, $response);
    }
1268219
public function onUserRegistered(PostRegisterEvent $event): void
    {
        $user = $event->getUser();

        if ($user->enabled) {
            $this->mailHelper
                ->sendMail(
                    [$user->email => $this->getUserName($user)],
                    'ngsite.user.welcome.subject',
                    $this->configResolver->getParameter('template.user.mail.welcome', 'ngsite'),
                    [
                        'user' => $user,
                    ]
                );

            return;
        }

        $accountKey = $this->ezUserAccountKeyRepository->create($user->id);

        if ($this->configResolver->getParameter('user.require_admin_activation', 'ngsite')) {
            $this->mailHelper
                ->sendMail(
                    [$user->email => $this->getUserName($user)],
                    'ngsite.user.activate.admin_activation_pending.subject',
                    $this->configResolver->getParameter('template.user.mail.activate_admin_activation_pending', 'ngsite'),
                    [
                        'user' => $user,
                    ]
                );

            $adminEmail = $this->configResolver->getParameter('user.mail.admin_email', 'ngsite');
            $adminName = $this->configResolver->getParameter('user.mail.admin_name', 'ngsite');

            if (!empty($adminEmail)) {
                $this->mailHelper
                    ->sendMail(
                        !empty($adminName) ? [$adminEmail => $adminName] : [$adminEmail],
                        'ngsite.user.activate.admin_activation_required.subject',
                        $this->configResolver->getParameter('template.user.mail.activate_admin_activation_required', 'ngsite'),
                        [
                            'user' => $user,
                        ]
                    );
            }

            return;
        }

        $this->mailHelper
            ->sendMail(
                [$user->email => $this->getUserName($user)],
                'ngsite.user.activate.subject',
                $this->configResolver->getParameter('template.user.mail.activate', 'ngsite'),
                [
                    'user' => $user,
                    'hash' => $accountKey->getHash(),
                ]
            );
    }
686196
public function send($entityId, $text, $userIds, $emails)
    {
        $messageData = $this->buildMessageData($text, $entityId);

        return $this->callSendMessage($userIds, $emails, $messageData);
    }
430726
public static function trigger(string $event, $data = []) {
		$result = null;
		if (isset(self::$events[$event])) {
			foreach (self::$events[$event] as $callback) {
				$result = Utils::call($callback, $data);
				if ($result !== null) {
					break;
				}
			}
		}
		return $result;
	}
377103
public function sendSubscription(array $data = [])
    {
        $params = $this->formatMessage($data);

        $this->restoreMessage();

        return $this->httpPostJson('cgi-bin/message/template/subscribe', $params);
    }
192018
public function registerMailPartials(array $definitions)
    {
        if (!$this->registeredPartials) {
            $this->registeredPartials = [];
        }

        $this->registeredPartials = $definitions + $this->registeredPartials;
    }
369679
protected function registerServerEvents(array $events): void
    {
        $eventInfo = [];

        // register event to swoole
        foreach ($events as $name => $cb) {
            // is a Closure callback, add by self::onSwoole()
            if (\is_object($cb) && \method_exists($cb, '__invoke')) {
                $eventInfo[] = [$name, \get_class($cb)];
                $this->server->on($name, $cb);
                continue;
            }

            if (\is_string($cb)) {
                if (\is_int($name)) {
                    $name = $cb;
                }

                $method = SwooleEvent::getHandler($cb);
                if ($method && \method_exists($this, $method)) {
                    $eventInfo[] = [$name, static::class . "->$method"];
                    $this->server->on($name, [$this, $method]);
                } elseif (\function_exists($cb)) {
                    $eventInfo[] = [$name, $cb];
                    $this->server->on($name, $cb);
                }
            }
        }

        Show::table($eventInfo, 'Registered events to the server', [
            'showBorder' => 0,
            'columns'    => ['event name', 'swoole event handler']
        ]);
    }
896418
protected function onInput($data)
    {
        $func = $this->params;

        $data = $func($data);
        if ($data) {
            $this->next($data);
        }
    }
1026583
private function addEdgesFromArray(array $data)
    {
        $_edgeClass = $this->_edgeClass;

        $this->_result[] = $_edgeClass::createFromArray($data, $this->_options);
    }
1310274
public function createEvent(array $data)
    {
        $json = json_encode($data);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }