Set the files on mail surface.

@return void
16884
private function setAttachments()
    {
        $attachments = $this->mailable->get('_attachments');

        if (!is_null($attachments)) {
            foreach ($attachments as $attachment) {
                if (in_array('name')) {
                    $this->message->attach(Attachment::fromPath($attachment['file'])->setFilename($attachment['name']));
                } else {
                    $this->message->attach(Attachment::fromPath($attachment['file']));
                }
            }
        }
    }
973198
public function setPostal($postal)
	{
		if ( $postal == $this->getPostal() ) { return; }

		$this->_values['postal'] = (string) $postal;
		$this->setModified();
	}
1221472
protected function set_items() {
		$show_on_front  = get_option( 'show_on_front' );
		$page_for_posts = get_option( 'page_for_posts' );
		if ( 'page' === $show_on_front && $page_for_posts ) {
			$title = get_the_title( $page_for_posts );
			$this->set( $title );
		}
	}
382120
protected function setDerivedFileProperties()
    {
        if ( ! $this->file || ! file_exists($this->file->getRealPath())) {
            throw new RuntimeException("Local file not found at {$this->file->getPath()}");
        }

        $this->size = $this->file->getSize();

        if (null === $this->name) {
            $this->name = $this->file->getBasename();
        }
    }
994776
public function notify()
    {
        if ($this->form)
        {
            if ($this->form->emailsAsArray)
            {
                foreach ($this->form->emailsAsArray as $email)
                {
                    \Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/modules/cms/form2/mail';

                    $message = \Yii::$app->mailer->compose('send-message', [
                        'form'              => $this->form,
                        'formSend'          => $this
                    ])
                    ->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName])
                    ->setTo($email)
                    ->setSubject(\Yii::t('skeeks/form2/app', 'Submitting form') . ": «{$this->form->name}» #" . $this->id)
                    ;

                    $rp = $this->relatedPropertiesModel;
                    $rp->initAllProperties();

                    foreach ($rp->toArray() as $code => $value)
                    {
                        $property = $rp->getRelatedProperty($code);

                        if ($property && $property->handler instanceof PropertyTypeStorageFile) {
                            if ($property->handler->isMultiple) {
                                if ($files = StorageFile::find()->where(['id' => $value])->all()) {
                                    /**
                                     * @var StorageFile $file
                                     */
                                    foreach ($files as $file)
                                    {
                                        $message->attach($file->getRootSrc());
                                    }
                                }
                            } else {
                                if ($file = StorageFile::find()->where(['id' => $value])->one()) {
                                    /**
                                     * @var StorageFile $file
                                     */
                                    $message->attach($file->getRootSrc());
                                }
                            }
                        }
                    }


                    $message->send();
                }
            }
        }
    }
434798
public function setFileHead(): void
    {
        // check local service file
        $this->fileHead = $this->prepareFilePath('head', false);
        if (!file_exists($this->fileHead)) {
            // look up for default file
            $this->fileHead = $this->prepareDefaultFilePath('head');
        }
    }
133250
public function setToField() {

        // get the mapped recipient (valid because $this->isInboundEmailToEmailAddressMapToUser() is already done)
        $mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');

        foreach ($mappedRoutes as $route => $user) {

            // if "from" email address is the same as the route specified in the config...
            if ($this->request->input('recipient') == $route) {
                $userEmailAddress = $user;
            }
        }

        return $this->userRepository->findUserNameByEmail($userEmailAddress);
    }
286193
protected function set_boundaries()
	{
		$uniq_id = md5(uniqid(microtime(true)));

		// Message part boundary, (separates message and attachments).
		$this->boundaries[0] = 'B1_'.$uniq_id;

		// Message body boundary (separates message, alt message)
		$this->boundaries[1] = 'B2_'.$uniq_id;

		$this->boundaries[2] = 'B3_'.$uniq_id;
	}
664055
protected function sendEmail($message): void
    {
        $snooze = \is_numeric($this->emailSnooze)
            ? $this->emailSnooze
            : \strtotime($this->emailSnooze) - \time();

        if ($this->email && $this->mailer
            && @\filemtime($this->directory . '/email-sent') + $snooze < \time() // @ file may not exist
            && @\file_put_contents($this->directory . '/email-sent', 'sent') // @ file may not be writable
        ) {
            ($this->mailer)($message, \implode(', ', (array) $this->email));
        }
    }
769341
protected function setPagerListFile()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->file->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
535796
protected function filesystems()
    {
        $arrResult = Parser::df();
        foreach ($arrResult as $dev) {
            $this->sys->setDiskDevices($dev);
        }
    }
1155198
public function setTargetfile()
	{
		//set the upload_path_relative
		$this->upload_path_relative = $this->upload_path . $this->target_file_name;

		//set the full target file path
		$this->target_file = $this->target_dir . $this->target_file_name;

		return $this;

	}
1263394
public function setArchived($value)
    {
        $this->_validateNotNull('Archived', $value);
        $this->_validateInt('Archived', $value);

        if ($this->data['archived'] === $value) {
            return;
        }

        $this->data['archived'] = $value;

        $this->_setModified('archived');
    }
1122768
private function setInput()
    {
        $this->inputFile = $_FILES[$this->field]['name'];
        $this->inputHash = hash_file('md5', $_FILES[$this->field]['tmp_name']);
    }
1349545
public static function setScanDir()
    {
        if (!getenv("BARTLETT_SCAN_DIR")) {
            $home = defined('PHP_WINDOWS_VERSION_BUILD') ? 'USERPROFILE' : 'HOME';
            $dirs = array(
                realpath('.'),
                getenv($home) . DIRECTORY_SEPARATOR . '.config',
                DIRECTORY_SEPARATOR . 'etc',
            );
            putenv("BARTLETT_SCAN_DIR=" . implode(PATH_SEPARATOR, $dirs));
        }
    }
605832
private function setSettings() {
		$this->template->uploadUrl = $this->controller->link("upload");
		$this->template->renameLink = $this->controller->link("rename");
		$this->template->removeLink = $this->controller->link("//remove");
		$this->template->inputId = $this->renderer->getElements()["input"]->attrs["id"];
		
		$this->needTranslate();
		$this->template->messages = $this->controller->getUploadControl()->getMessages();
		
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->maxFiles = $this->controller->getUploadControl()->getMaxFiles();
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->maxFileSize = $this->controller->getUploadControl()->getMaxFileSize();
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->fileSizeString = $this->controller->getUploadControl()->getFileSizeString();
		$this->template->productionMode = Debugger::$productionMode;
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->token = $this->controller->getUploadControl()->getToken();
		$this->template->params = json_encode($this->controller->getUploadControl()->getParams());
		$this->template->settings = $this->controller->getUploadControl()->getUploadSettings();
		
		$default = $this->controller->getUploadControl()->getDefaultFiles();
		
		$defaultFiles = [];
		foreach($default as $file) {
			$defaultFiles[] = $file->toArray();
		}
		
		$this->template->defaultFiles = $defaultFiles;
	}
525901
protected function setCache()
    {
        if ($this->cache) {
            $cacheFile = $this->getCacheFile();
            file_put_contents($cacheFile, $this->templateOutput);
        }
    }