direct_mail icon indicating copy to clipboard operation
direct_mail copied to clipboard

Image url in plain text is wrong

Open pengmaradi opened this issue 6 years ago • 0 comments

News letter in e-mail has wrong url, which likes http://domain.com/uploads/pics/1

to fix this in file https://github.com/kartolo/direct_mail/blob/develop/Classes/Plugin/DirectMail.php

  /**
     * Get images from image field and store this images to $images_arr
     *
     * @param array $imagesArray The image array
     * @param string $upload_path The upload path
     *
     * @return	void
     */
    public function getImagesStandard(array &$imagesArray, $uploadPath='uploads/pic/')
    {
		$uid = (int)$this->cObj->data['uid'];
        $images = explode(',', $this->cObj->data['image']);
		$fileRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\FileRepository::class);
	$fileObjects = $fileRepository->findByRelation('tt_content', 'image', $uid);
	//$imageOriginalFile = $fileObjects[0]->getOriginalFile()->getIdentifier();
        foreach ($fileObjects as $file) {
                $imagesArray[] = $this->siteUrl . 'fileadmin'. $file->getOriginalFile()->getIdentifier();
        }
    }

pengmaradi avatar Dec 14 '18 10:12 pengmaradi