Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit e805fe1

Browse files
Raukzeandi34
authored andcommitted
Update mail body logic
- only use alt_text if we can assure that it is set - use msgHTML() if email type is HTML and alt_text is not set - in all other cases just use the regular text as body
1 parent c09fd07 commit e805fe1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

api/sendPic.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@
5656

5757
// Email body content
5858
$mail->isHTML( $config['mail']['is_html'] );
59-
$mail->Body = $config['mail']['text'];
6059
if ($config['mail']['is_html']) {
61-
$mail->AltBody = $config['mail']['alt_text'];
60+
if (isset($config['mail']['alt_text']) && empty($config['mail']['alt_text'])) {
61+
$mail->msgHTML($config['mail']['text']);
62+
} else {
63+
$mail->Body = $config['mail']['text'];
64+
$mail->AltBody = $config['mail']['alt_text'];
65+
}
66+
} else {
67+
$mail->Body = $config['mail']['text'];
6268
}
6369

6470
// for send an attachment

0 commit comments

Comments
 (0)