Answers the message for the email.

@return string
762998
public function getMessage()
    {
        if ($this->EmailMessage) {
            return sprintf('%s %s', rtrim($this->EmailMessage), $this->getCurrentPageLink());
        }
        
        return $this->getCurrentPageLink();
    }
1028360
public function getMailTemplate()
    {
        $chunks = explode('\\', get_class($this));
        $className = array_pop($chunks);

        return [
            uncamelcase($className),
            'community_translation',
        ];
    }
1052365
public function getEmailContent() : string
    {
        $result = '';

        $module = Inflector::singularize($this->table->getAlias());
        $displayValue = $this->getDisplayValue();
        $user = $this->getUserString();
        $action = $this->entity->isNew() ? 'created' : 'updated';

        // Example: Lead Foobar created by System
        $result = sprintf("%s %s %s by %s", $module, $displayValue, $action, $user);

        $changeLog = $this->getChangelog();
        if (!empty($changeLog)) {
            $result .= "\n\n";
            $result .= $changeLog;
            $result .= "\n";
        }

        $result .= "\n\n";
        $result .= "See more: ";
        $result .= $this->getEntityUrl();

        return $result;
    }
956206
public function email() : Text
    {
        return $this->pipe(
            self::predicate(
                function (string $value) : bool {
                    return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
                },
                'not an email'
            )
        );
    }
144872
public function getFormattedMessageBody()
    {
        $msgBody = $this->getMessageBody();
        $txt = Loader::helper('text');

        $repliedPos = strpos($msgBody, $this->getMessageDelimiter());
        if ($repliedPos > -1) {
            $repliedText = substr($msgBody, $repliedPos);
            $messageText = substr($msgBody, 0, $repliedPos);
            $msgBody = $messageText . '<div class="ccm-profile-message-replied">' . nl2br($txt->entities($repliedText)) . '</div>';
            $msgBody = str_replace($this->getMessageDelimiter(), '<hr />', $msgBody);
        } else {
            $msgBody = nl2br($txt->entities($msgBody));
        }

        return $msgBody;
    }
264867
public function checkEmail() {
    if ($this->email === '') {
      return ['result' => true, 'message' => ''];
    }
    if (empty($this->email)) {
      return ['result' => false, 'message' => 'Please specify a valid email.'];
    }
    if (!preg_match(
        '/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i',
        $this->email
    )) {
      return [
        'result' => false,
        'message' => 'Email must be a correctly formatted address.'
      ];
    }
    $selector = ['&',
      'ilike' => [
        'email',
        str_replace(['\\', '%', '_'], ['\\\\\\\\', '\%', '\_'], $this->email)
      ]
    ];
    if (isset($this->guid)) {
      $selector['!guid'] = $this->guid;
    }
    $test = Nymph::getEntity(
        ['class' => '\Tilmeld\Entities\Group', 'skip_ac' => true],
        $selector
    );
    if (isset($test->guid)) {
      return [
        'result' => false,
        'message' => 'That email address is already registered.'
      ];
    }

    return [
      'result' => true,
      'message' => (
        isset($this->guid) ? 'Email is valid.' : 'Email address is valid!'
      )
    ];
  }
177982
public function getMailHeadersAsString()
    {
        $headerString = "";

        foreach ($this->getMailHeaders() as $header => $value) {
            $headerString .= $header . ": " . $value . "\r\n";
        }

        return trim($headerString);
    }
1181930
public function toString()
    {
        $email = '<' . Mime::encodeEmail($this->email()) . '>';
        $name = $this->name();
        return $name ? Mime::encodeValue($name) . ' ' . $email : $email;
    }
1204824
public function getMessageString()
    {
        $str = $this->pri;
        $str .= implode(' ', $this->header);

        if ($this->message['APP-NAME']) {
            $str .= ' ' . $this->message['APP-NAME'] . ': ' . $this->message['MSG'];
        } else {
            $str .= ' ' . $this->message['MSG'];
        }
        return $str;
    }
461709
protected function guessEmailVerificationBroker(): string
    {
        $accessarea = str_before(Route::currentRouteName(), '.');
        $emailVerificationBroker = str_plural(mb_strstr($accessarea, 'area', true));

        return config('auth.passwords.'.$emailVerificationBroker) ? $emailVerificationBroker : config('auth.defaults.passwords');
    }
1310382
public function getSender()
    {
        $sender = $this->createSender();

        $sender->setFrom($this->fromEmail, $this->fromName);

        if ($this->replyToEmail) {
            $sender->setReplyTo($this->replyToEmail);
        }

        return $sender;
    }
1178929
public function submitMessage()
    {
        $messageMapper = ($this->container->dataMapper)('MessageMapper');
        $email = $this->container->emailHandler;

        // Check honepot and if clean, then submit message
        if ('alt@example.com' === $this->request->getParsedBodyParam('alt-email')) {
            $message = $messageMapper->make();
            $message->name = $this->request->getParsedBodyParam('name');
            $message->email = $this->request->getParsedBodyParam('email');
            $message->message = $this->request->getParsedBodyParam('message');
            $messageMapper->save($message);

            // Send message to workflow email
            $siteName = empty($this->siteSettings['displayName']) ? 'PitonCMS' : $this->siteSettings['displayName'];
            $email->setTo($this->siteSettings['contactFormEmail'], '')
                    ->setSubject("New Contact Message to $siteName")
                    ->setMessage("From: {$message->email}\n\n{$message->message}")
                    ->send();
        }

        // Set the response type and return
        $r = $this->response->withHeader('Content-Type', 'application/json');
        return $r->write(json_encode(["response" => $this->siteSettings['contactFormAcknowledgement']]));
    }
515762
public function confirmEmailAction()
    {
        $code = $this->dispatcher->getParam('code');

        $confirmation = EmailConfirmations::findFirstByCode($code);

        if (!$confirmation) {
            return $this->dispatcher->forward([
                'controller' => 'index',
                'action' => 'index'
            ]);
        }

        if ($confirmation->confirmed != 'N') {
            return $this->dispatcher->forward([
                'controller' => 'session',
                'action' => 'login'
            ]);
        }

        $confirmation->confirmed = 'Y';

        $confirmation->user->active = 'Y';

        /**
         * Change the confirmation to 'confirmed' and update the user to 'active'
         */
        if (!$confirmation->save()) {

            foreach ($confirmation->getMessages() as $message) {
                $this->flash->error($message);
            }

            return $this->dispatcher->forward([
                'controller' => 'index',
                'action' => 'index'
            ]);
        }

        /**
         * Identify the user in the application
         */
        $this->auth->authUserById($confirmation->user->id);

        /**
         * Check if the user must change his/her password
         */
        if ($confirmation->user->mustChangePassword == 'Y') {

            $this->flash->success('The email was successfully confirmed. Now you must change your password');

            return $this->dispatcher->forward([
                'controller' => 'users',
                'action' => 'changePassword'
            ]);
        }

        $this->flash->success('The email was successfully confirmed');

        return $this->dispatcher->forward([
            'controller' => 'users',
            'action' => 'index'
        ]);
    }
441726
public function getReceivedText()
    {
        if ($this->isUserMessage()) {
            return isset($this->message->text) ? $this->message->text : '';
        }

        return '';
    }
1183322
protected function sendViaMail()
    {
        $headers = '';

        if ($this->isHtml) {
            $headers = 'Content-Type: text/html' . PHP_EOL;
        }

        $headers .= 'From: ' . $this->getFrom() . PHP_EOL;

        $emailTo = array();
        foreach ($this->emailTo as $email => $name) {
            $thisTo = $email;

            if (!is_null($name)) {
                $thisTo = '"' . $name . '" <' . $thisTo . '>';
            }

            $emailTo[] = $thisTo;
        }

        $emailTo = implode(', ', $emailTo);

        return mail($emailTo, $this->subject, $this->body, $headers);
    }
246743
public function getNameAndEmail() {
        $display = '';
        if ( isset($this->displayname) && strlen($this->displayname) > 0 ) {
            $display = $this->displayname;
        }
        if ( isset($this->email) && strlen($this->email) > 0 ) {
            if ( strlen($display) > 0 ) {
                $display .= ' ('.$this->email.')';
            } else {
                $display = $this->email;
            }
        }
        $display = trim($display);
        if ( strlen($display) < 1 ) return false;
        return $display;
    }
1197069
public function getMailContent()
    {
        if (!empty($this->owner->SuccessMessageMail)) {
            return $this->owner->dbObject('SuccessMessageMail');
        } else {
            return SiteConfig::current_site_config()->dbObject('SuccessMessageMail');
        }
    }