File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -176,10 +176,6 @@ protected function fetch() {
176176 }
177177 }
178178 }
179-
180- if ($ this ->type == 'image ' ) {
181- $ this ->img_src = 'data: ' .$ this ->content_type .';base64, ' .base64_encode ($ this ->content );
182- }
183179 }
184180
185181 /**
@@ -256,6 +252,9 @@ public function getDisposition() {
256252 * @return null|string
257253 */
258254 public function getImgSrc () {
255+ if ($ this ->type == 'image ' && $ this ->img_src == null ) {
256+ $ this ->img_src = 'data: ' .$ this ->content_type .';base64, ' .base64_encode ($ this ->content );
257+ }
259258 return $ this ->img_src ;
260259 }
261260
Original file line number Diff line number Diff line change @@ -280,8 +280,9 @@ public function getHTMLBody($replaceImages = false) {
280280 $ body = $ this ->bodies ['html ' ]->content ;
281281 if ($ replaceImages ) {
282282 $ this ->attachments ->each (function ($ oAttachment ) use (&$ body ) {
283- if ($ oAttachment ->id && isset ($ oAttachment ->img_src )) {
284- $ body = str_replace ('cid: ' .$ oAttachment ->id , $ oAttachment ->img_src , $ body );
283+ /** @var Attachment $oAttachment */
284+ if ($ oAttachment ->id && $ oAttachment ->getImgSrc () != null ) {
285+ $ body = str_replace ('cid: ' .$ oAttachment ->id , $ oAttachment ->getImgSrc (), $ body );
285286 }
286287 });
287288 }
@@ -801,6 +802,7 @@ public function getEncoding($structure) {
801802 *
802803 * @return null|Folder
803804 * @throws Exceptions\ConnectionFailedException
805+ * @throws InvalidMessageDateException
804806 */
805807 public function getContainingFolder (Folder $ folder = null ) {
806808 $ folder = $ folder ?: $ this ->client ->getFolders ()->first ();
You can’t perform that action at this time.
0 commit comments