Add the attachments to the message.

@param  \Illuminate\Mail\Message  $mailMessage
@param  \Illuminate\Notifications\Messages\MailMessage  $message
@return void
766843
protected function addAttachments($mailMessage, $message)
    {
        foreach ($message->attachments as $attachment) {
            $mailMessage->attach($attachment['file'], $attachment['options']);
        }

        foreach ($message->rawAttachments as $attachment) {
            $mailMessage->attachData($attachment['data'], $attachment['name'], $attachment['options']);
        }
    }
164157
protected function addAttachments($incomingMessage)
    {
        $attachment = $this->event->get('attachment');

        if ($attachment === self::ATTACHMENT_IMAGE) {
            $images = $this->files->map(function ($file) {
                if ($file instanceof UploadedFile) {
                    $path = $file->getRealPath();
                } else {
                    $path = $file['tmp_name'];
                }

                return new Image($this->getDataURI($path));
            })->values()->toArray();
            $incomingMessage->setText(Image::PATTERN);
            $incomingMessage->setImages($images);
        } elseif ($attachment === self::ATTACHMENT_AUDIO) {
            $audio = $this->files->map(function ($file) {
                if ($file instanceof UploadedFile) {
                    $path = $file->getRealPath();
                } else {
                    $path = $file['tmp_name'];
                }

                return new Audio($this->getDataURI($path));
            })->values()->toArray();
            $incomingMessage->setText(Audio::PATTERN);
            $incomingMessage->setAudio($audio);
        } elseif ($attachment === self::ATTACHMENT_VIDEO) {
            $videos = $this->files->map(function ($file) {
                if ($file instanceof UploadedFile) {
                    $path = $file->getRealPath();
                } else {
                    $path = $file['tmp_name'];
                }

                return new Video($this->getDataURI($path));
            })->values()->toArray();
            $incomingMessage->setText(Video::PATTERN);
            $incomingMessage->setVideos($videos);
        } elseif ($attachment === self::ATTACHMENT_FILE) {
            $files = $this->files->map(function ($file) {
                if ($file instanceof UploadedFile) {
                    $path = $file->getRealPath();
                } else {
                    $path = $file['tmp_name'];
                }

                return new File($this->getDataURI($path));
            })->values()->toArray();
            $incomingMessage->setText(File::PATTERN);
            $incomingMessage->setFiles($files);
        }

        return $incomingMessage;
    }
704158
protected function setText($email, Swift_Mime_Message $message)
	{
		foreach ($message->getChildren() as $attachment) {
			if (!$attachment instanceof Swift_MimePart) {
				continue;
			}
			$email->setText($attachment->getBody());
		}
	}
44463
public function addMessage($text)
	{
		$this->isValid = false;
		$this->messages[] = $this->commonComment . $text;
	}
544118
public function send(Message $message)
    {
        $em = $this->getEventManager();
        $event = $this->getEvent();
        $event->setMessage($message);
        $event->setName(SenderEvent::EVENT_SEND_PRE);
        $em->triggerEvent($event);
        $this->transport->send($message);
        $event->setName(SenderEvent::EVENT_SEND_POST);
        $em->triggerEvent($event);
    }
319819
private function keepMessage($level, $message) {
		if(static::LOG_LEVELS[$this->keepMessages] > static::LOG_LEVELS[$level]) {
			return;
		}

		if($level == '' || $level == 'LOG'){
			$keepMessage = $message;
		} else {
			$keepMessage = $level . " " . $message;
		}
		$this->logEntries[] = $keepMessage;
	}
862193
public static function add(string $messageType, string $message): void
    {
        $_SESSION[self::SESSION_KEY][$messageType][] = $message;
    }
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
991001
public function add(Message $message, $groupName = null) {
		if (!isset($this->messages[$groupName])) {
			$this->messages[$groupName] = array();
		}	
		
		$this->messages[$groupName][] = $message;
	}
1036875
private function attachFiles(){
        if (count($this->attachments) === 0) {
            return;
        }
        // Get old message parts
        $mimeMessage = $this->message->getBody();
        if (is_string($mimeMessage)) {
            $originalBodyPart = new Mime\Part($mimeMessage);
            $originalBodyPart->type = $mimeMessage != strip_tags($mimeMessage)
                ? Mime\Mime::TYPE_HTML
                : Mime\Mime::TYPE_TEXT;
            // A Mime\Part body will be wraped into a Mime\Message, ensuring we handle a Mime\Message after this point
            $this->setBody($originalBodyPart);
            $mimeMessage = $this->message->getBody();;
        }
        $oldParts = $mimeMessage->getParts();
        // Generate a new Mime\Part for each attachment
        $attachmentParts    = [];
        $info               = new \finfo(FILEINFO_MIME_TYPE);
        foreach ($this->attachments as $key => $attachment) {
            if (! is_file($attachment)) {
                continue; // If checked file is not valid, continue to the next
            }
            // If the key is a string, use it as the attachment name
            $basename = is_string($key) ? $key : basename($attachment);
            $part               = new Mime\Part(fopen($attachment, 'r'));
            $part->id           = $basename;
            $part->filename     = $basename;
            $part->type         = $info->file($attachment);
            $part->encoding     = Mime\Mime::ENCODING_BASE64;
            $part->disposition  = Mime\Mime::DISPOSITION_ATTACHMENT;
            $attachmentParts[]  = $part;
        }
        $body = new Mime\Message();
        $body->setParts(array_merge($oldParts, $attachmentParts));
        $this->message->setBody($body);
    }
917430
public function saveAttachments($mail)
    {
        /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment[] $attachments */
        $attachments = $mail->getAttachments();

        foreach ($attachments as $attachment) {
            $this->saveAttachment($attachment);
        }

        return $this;
    }
597264
public function addFlashMessage(FlashMessage $flashMessage)
    {
        $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
        $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($this->messageQueueByIdentifier);
        $flashMessageQueue->enqueue($flashMessage);
    }
828344
public function add(string $requestMessage = null) : void
    {
        if ($this->onlineIdParameter() === 'me') return;

        $data = ($requestMessage === null) ? new \stdClass() : [
            "requestMessage" => $requestMessage
        ];

        $this->postJson(sprintf(self::USERS_ENDPOINT . 'friendList/%s', $this->client->onlineId(), $this->onlineId()), $data);
    }
981587
public function send(Message $mail): void
    {
        if (!$this->mailers) {
            throw new InvalidArgumentException('At least one mailer must be provided.');
        }

        $failures = [];
        for ($i = 0; $i < $this->retryCount; $i++) {
            if ($i > 0) {
                \usleep($this->retryWaitTime * 1000);
            }

            foreach ($this->mailers as $mailer) {
                try {
                    $mailer->send($mail);

                    return;

                } catch (SendException $e) {
                    $failures[] = $e;
                    null === $this->onFailure || ($this->onFailure)($this, $e, $mailer, $mail);
                }
            }
        }

        $e = new FallbackMailerException('All mailers failed to send the message.');
        $e->failures = $failures;
        throw $e;
    }
1127438
public function handle(DomainMessage $domainMessage): void
    {
        $event = $domainMessage->getPayload();

        foreach ($this->sagas as $sagaType => $saga) {
            $metadata = $this->metadataFactory->create($saga);

            if (! $metadata->handles($event)) {
                continue;
            }

            $state = $this->stateManager->findOneBy($metadata->criteria($event), $sagaType);

            if (null === $state) {
                continue;
            }
            $this->eventDispatcher->dispatch(
                SagaManagerInterface::EVENT_PRE_HANDLE,
                [$sagaType, $state->getId()]
            );

            $newState = $saga->handle($event, $state);

            $this->eventDispatcher->dispatch(
                SagaManagerInterface::EVENT_POST_HANDLE,
                [$sagaType, $state->getId()]
            );

            $this->repository->save($newState, $sagaType);
        }
    }
719313
public function record(EventMessage $message): void
    {
        $eventRecord = new EventRecord(
            $message,
            $this->aggregateId,
            $this->aggregateType,
            $this->nextSequence()
        );
        $this->lastSequence = $eventRecord->sequenceNumber();
        $this->eventRecords->add($eventRecord);
    }
299131
public function add($key, $message)
    {
        if (! isset($this->errors[$key])) $this->errors[$key] = [];
        $this->errors[$key][] = $message;
    }