Prepare the email

@param  int   $id   The "email_messages" table's ID field
@return array
490184
public function prepEmailData($id) {

        $email = $this->email_message->find($id);

        // Build the email data
        // $data is an array
        $data = [];
        $data['from_name']            = $email->from_name;
        $data['from_email_address']   = $email->from_email_address;
        $data['to_name']              = $email->to_name;
        $data['to_email_address']     = $email->to_email_address;
        $data['subject']              = $email->subject;
        $data['body']                 = $email->body;
        $data['site_name']            = config('lasallecmsfrontend.site_name');
        $data['sender_email_address'] = "info@southlasalle.com";

        return $data;
    }
652875
public function foreignKeyCheck($id) {

        // 'related_table' is the table name
        return  [
            [ 'related_table' => 'milestones', 'count' => $this->milestoneCount($id) ],
            [ 'related_table' => 'projects', 'count' => $this->projectCount($id) ],
            [ 'related_table' => 'todo_items', 'count' => $this->todo_itemCount($id) ],
        ];
    }
541800
public function smtpGetEmailInfoById($id)
    {
        if (empty($id)) {
            return $this->handleError('Empty id');
        }

        $requestResult = $this->sendRequest('/smtp/emails/' . $id);

        return $this->handleResult($requestResult);
    }
1232178
public function convertToRconData($id)
    {
        $idAndTypePacked = pack('VV', $id, $this->type);
        $endOfMessage    = chr(0) . chr(0);

        $message = $idAndTypePacked . $this->body . $endOfMessage;

        $data = pack("V", strlen($message)) . $message;

        return $data;
    }
1053541
private function getComponentConfig(string $id): array
    {
        foreach ($this->storage[$id]['arguments'] as &$value) {
            $this->resolveComponent($value);
        }
        return $this->storage[$id];
    }
899818
protected function _prepareRecipientAddresses($email)
    {
        $to = $email->getTo();
        $cc = $email->getCc();
        $bcc = $email->getBcc();

        return array_merge(array_keys($to), array_keys($cc), array_keys($bcc));
    }
840015
public function prepare($id)
    {
        // Prepare singularity only if
        // we are on the valid screen.
        if ($this->isValidScreen()) {
            // Get model metadata values.
            $collection = $this->getModel()->getMeta($id);

            // Set model metadata as singularity values.
            $this->setValue($collection->toArray());

            // Get singularity fields and boost
            // its schema with meta values.
            $this->getFields()->boostSchemaWithValues($this->getValue());

            // Dispach singularity to the view.
            $this->manager->dispatch();
        }
    }
554102
public function actionPreview($id)
    {
        $emailSpool = $this->loadModel($id);
        echo CHtml::tag('div', array('style' => 'font-family: Arial; font-weight: bold;'), $emailSpool->subject) . '<hr/>';
        echo $emailSpool->swiftMessage->getBody();
    }
1333462
protected function prepareUniqueId($id)
    {
        if (preg_match('/\[(.*)\]/', $id, $matches)) {
            $id = $this->getValue($matches[1]);
        }

        if (strtolower($id) === 'null') {
            $id = null;
        }

        if (filter_var($id, FILTER_VALIDATE_INT) !== false) {
            $id = (int) $id;
        }

        return $id;
    }
752542
public function exportById($id): array
    {
        $section = Craft::$app->sections->getSectionById((int) $id);

        return $this->export($section);
    }
271718
public function actionMessage($id)
    {
        $model = $this->findModel($id);
        $message = new Message($this->getWechat());

        if ($message->load(Yii::$app->request->post())) {
            $message->toUser = $model->open_id;
            if ($message->send()) {
                $this->flash('消息发送成功!', 'success');
                $message = new Message($this->getWechat());
            }
        }
        $message->toUser = $model->open_id;

        $searchModel = new MessageHistorySearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
//        $dataProvider->sort = [
//            'defaultOrder' => ['created_at' => SORT_DESC]
//        ];
        $dataProvider->query
            ->wechat($this->getWechat()->id)
            ->wechatFans($model->open_id, $this->getWechat()->original);

        return $this->render('message', [
            'model' => $model,
            'message' => $message,
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
38644
public function CharacterPictures(int $id): array
    {
        return $this->myanimelist->getCharacterPictures(
            new Request\Character\CharacterPicturesRequest($id)
        );
    }
336834
public function exportById($id): array
    {
        $globalSet = Craft::$app->globals->getSetById((int) $id);

        return $this->export($globalSet);
    }
960181
public function markEmailAsRead($id) {

        $emailMessage = $this->model->find($id);

        $emailMessage->read = 1;

        return $emailMessage->save();
    }
1161226
public function update($id)
	{
		$messages = $this->users->validForUpdate(
			$id,
			Input::get('first_name'),
			Input::get('last_name'),
			Input::get('email'),
			Input::get('password')
		);

		if (count($messages) > 0)
		{
			return Response::json($messages->all(), 400);
		}

		return $this->users->update(
			$id,
			Input::get('first_name'),
			Input::get('last_name'),
			Input::get('email'),
			(bool) Input::get('active'),
			Input::get('password')
		);
	}
950561
private function prepareMessages()
    {
        $prepared = [];

        foreach ($this->messages as $key => $msg) {
            $prepared[(string)$key] = $msg;
        }

        $this->messages = $prepared;
    }
127102
public function show($id)
    {
        $lists      = $this->mailjet->getAllLists();
        $newsletter = $this->newsletter->find($id);

        return view('newsletter::Backend.template.show')->with(['newsletter' => $newsletter, 'lists' => $lists]);
    }