diff --git a/api/sendPic.php b/api/sendPic.php index 6b5c2ae29..2e414ce68 100644 --- a/api/sendPic.php +++ b/api/sendPic.php @@ -55,12 +55,21 @@ $mail->Subject = $config['mail']['subject']; // Email body content -$mailContent = $config['mail']['text']; +$mail->isHTML( $config['mail']['is_html'] ); +if ($config['mail']['is_html']) { + if (isset($config['mail']['alt_text']) && empty($config['mail']['alt_text'])) { + $mail->msgHTML($config['mail']['text']); + } else { + $mail->Body = $config['mail']['text']; + $mail->AltBody = $config['mail']['alt_text']; + } +} else { + $mail->Body = $config['mail']['text']; +} // for send an attachment $path = $config['foldersAbs']['images'] . DIRECTORY_SEPARATOR; -$mail->Body = $mailContent; if (!$mail->addAttachment($path . $postImage)) { die( json_encode([ diff --git a/config/config.inc.php b/config/config.inc.php index ebb3cc79f..2826e36fe 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -208,6 +208,8 @@ $config['mail']['send_all_later'] = false; $config['mail']['subject'] = null; // if empty, default translation is used $config['mail']['text'] = null; // if empty, default translation is used +$config['mail']['alt_text'] = null; // if empty, default translation is used +$config['mail']['is_html'] = false; $config['mail']['host'] = 'smtp.example.com'; $config['mail']['username'] = 'photobooth@example.com'; $config['mail']['password'] = 'yourpassword'; diff --git a/lib/configsetup.inc.php b/lib/configsetup.inc.php index 3867ef398..b3e166d1a 100644 --- a/lib/configsetup.inc.php +++ b/lib/configsetup.inc.php @@ -1209,6 +1209,19 @@ 'name' => 'mail[text]', 'value' => htmlentities($config['mail']['text']), ], + 'mail_alt_text' => [ + 'view' => 'advanced', + 'type' => 'input', + 'placeholder' => '', + 'name' => 'mail[alt_text]', + 'value' => htmlentities($config['mail']['alt_text']), + ], + 'mail_is_html' => [ + 'view' => 'advanced', + 'type' => 'checkbox', + 'name' => 'mail[is_html]', + 'value' => $config['mail']['is_html'], + ], 'mail_host' => [ 'view' => 'basic', 'type' => 'input', diff --git a/resources/lang/de.json b/resources/lang/de.json index 29bd1a229..374090245 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -156,12 +156,14 @@ "mail:mail_fromAddress": "Absende Adresse", "mail:mail_fromName": "Absender Name", "mail:mail_host": "E-Mail Host Adresse", + "mail:mail_is_html": "HTML E-Mail", "mail:mail_password": "Passwort", "mail:mail_port": "Port", "mail:mail_secure": "Sicherheit (tls oder ssl)", "mail:mail_send_all_later": "Eingegebene Email-Adressen in Datei speichern", "mail:mail_subject": "Betreff", "mail:mail_text": "Text", + "mail:mail_alt_text": "Alternativer Text", "mail:mail_username": "Benutzername des E-Mail Accounts", "mailError": "Fehler beim Senden der E-Mail", "mailSaved": "E-Mail-Adresse erfolgreich gespeichert", @@ -278,12 +280,14 @@ "manual:mail:mail_fromAddress": "Geben Sie Ihre Absenderadresse ein, die beim Senden von Bildern per E-Mail verwendet wird.", "manual:mail:mail_fromName": "Geben Sie Ihren Absendernamen ein, der beim Senden von Bildern per E-Mail verwendet wird.", "manual:mail:mail_host": "Geben Sie Ihre E-Mail-Host-Adresse ein.", + "manual:mail:mail_is_html": "Wenn diese Option aktiviert ist, unterstützt das Mail-Text-Feld HTML-Formatierungs- und semantische Markup-Funktionen.", "manual:mail:mail_password": "Geben Sie Ihr Passwort ein, mit dem Sie sich in Ihr E-Mail-Konto einloggen.", "manual:mail:mail_port": "Geben Sie den Port ein, über den E-Mails gesendet werden.", "manual:mail:mail_secure": "Geben Sie das Protokoll ein, welches für die Transportverschlüsselung zwischen dem E-Mail-Client und dem Mailserver verwendet werden soll (SSL oder TLS).", "manual:mail:mail_send_all_later": "Wenn diese Option aktiviert ist, werden eingegebene E-Mail-Adressen in einer Datenbank gespeichert anstatt das ausgewählte Bild direkt zu versenden. Dies kann beispielsweise verwendet werden, um nach einer Veranstaltung eine E-Mail mit allen Bildern oder einen Link zu einer Online-Galerie zu senden.", "manual:mail:mail_subject": "Geben Sie den Betreff ein, der beim Senden von Bildern per E-Mail verwendet wird.", "manual:mail:mail_text": "Geben Sie den Mail-Text ein, der beim Senden von Bildern per E-Mail verwendet wird.", + "manual:mail:mail_alt_text": "Wenn die Option HTML-E-Mail aktiviert ist, wird der Inhalt dieses Feldes dann zum Mail-Text, wenn der E-Mail-Client des Empfängers keine HTML-E-Mails anzeigen kann.", "manual:mail:mail_username": "Geben Sie den Benutzernamen ein, mit dem Sie sich in Ihrem E-Mail-Konto anmelden.", "manual:pictures:filters_defaults": "Wählen Sie einen Bildfilter, der standardmäßig nach der Aufnahme angewendet wird.", "manual:pictures:filters_disabled": "Wählen Sie Filter aus, die aus den verfügbaren Bildfiltern entfernt werden.", diff --git a/resources/lang/en.json b/resources/lang/en.json index 7994b2c66..44b509f3e 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -157,12 +157,14 @@ "mail:mail_fromAddress": "Return address", "mail:mail_fromName": "Sender name", "mail:mail_host": "E-mail host adress", + "mail:mail_is_html": "HTML E-Mail", "mail:mail_password": "Password", "mail:mail_port": "Port", "mail:mail_secure": "Security (tls or ssl)", "mail:mail_send_all_later": "Store email addresses in file", "mail:mail_subject": "Subject", "mail:mail_text": "Text", + "mail:mail_alt_text": "Alternative text", "mail:mail_username": "Username of the e-mail account", "mailError": "Error sending e-mail", "mailSaved": "E-mail address saved successfully", @@ -280,12 +282,14 @@ "manual:mail:mail_fromAddress": "Enter your return address which is used while sending pictures via email.", "manual:mail:mail_fromName": "Enter your sender name which is used while sending pictures via email.", "manual:mail:mail_host": "Enter your email host address.", + "manual:mail:mail_is_html": "If enabled, the mail text field supports HTML formatting and semantic markup capabilities.", "manual:mail:mail_password": "Enter your password used to login into your email account.", "manual:mail:mail_port": "Enter the port used for email.", "manual:mail:mail_secure": "Enter the protocol used for the transport encryption between the email client and the mail server (ssl or tls).", "manual:mail:mail_send_all_later": "If enabled, entered email adresses get stored inside a database instead sending choosed picture directly. For example, this can be used to send a mail with all pictures or a link to an online gallery after the event.", "manual:mail:mail_subject": "Enter the subject used while sending pictures via email.", "manual:mail:mail_text": "Enter the mail text which is used while sending pictures via email.", + "manual:mail:mail_alt_text": "If the HTML e-mail option is enabled, the content of this field will become the mail text if the email client of the receiver cannot display HTML emails.", "manual:mail:mail_username": "Enter the username used to login into your email account.", "manual:pictures:filters_defaults": "Choose an image filter which is applied by default after taking a picture.", "manual:pictures:filters_disabled": "Choose filters which get removed from the available image filters.",