add a header "Reply-To" with the email address

dev
Oana Ursuleasa 2025-02-13 16:59:06 +02:00
rodzic 8484d6998d
commit ec1c1d9dd8
2 zmienionych plików z 22 dodań i 4 usunięć

Wyświetl plik

@ -67,9 +67,9 @@ class CreateCardClass{
if (MAIL_NOTIFICATION) { if (MAIL_NOTIFICATION) {
if (!$response) { if (!$response) {
$inbox->reply($mailSender->origin); $inbox->reply($mailSender->origin,$mailSender->userId);
} }
$inbox->reply($mailSender->origin, $response); $inbox->reply($mailSender->origin,$mailSender->userId, $response);
} }
}else{ }else{
$cleanedDescription = $newcard->extractForwardedContent($data->description); $cleanedDescription = $newcard->extractForwardedContent($data->description);

Wyświetl plik

@ -54,7 +54,7 @@ class MailClass {
return $headerInfo; return $headerInfo;
} }
public function reply($sender, $response = null) { public function reply($sender, $sendername, $response = null) {
$server = NC_SERVER; $server = NC_SERVER;
if(strstr($server, "https://")) { if(strstr($server, "https://")) {
@ -99,8 +99,25 @@ class MailClass {
$subject = "A new card could not be created!"; $subject = "A new card could not be created!";
} }
//Inline image
$description = $response->description;
$pattern = '/\[(.*?)\]\((https?:\/\/.*\.(?:jpg|jpeg|png|gif))\)/i';
if (preg_match($pattern, $description)) {
$descriptionFormatted = preg_replace('/\[(.*?)\]\((.*?)\)/', '<img src="$2" alt="$1">', $description);
}else{
$descriptionFormatted = $description;
//Attachements
$attachments = $response->attachments;
if (!empty($attachments)) {
foreach ($attachments as $attachment) {
$descriptionFormatted .= "<br><a href=\"".NC_SERVER ."/remote.php/dav/files/".NC_USER."/Deck/".$attachment. "\" target='_blank'>$attachment</a><br>";
}
}
}
$bodySupport="<p><a href=\"" . NC_SERVER . "/index.php/apps/deck/board/{$response->board}/card/{$response->id}" . "\">{$response->title}</a></p>" $bodySupport="<p><a href=\"" . NC_SERVER . "/index.php/apps/deck/board/{$response->board}/card/{$response->id}" . "\">{$response->title}</a></p>"
."<p>{$response->description}</p>" ."<p>{$descriptionFormatted}</p>"
."<p>Sent by: {$sender} </p>"; ."<p>Sent by: {$sender} </p>";
@ -126,6 +143,7 @@ class MailClass {
* EMAIL 2: email to support team * EMAIL 2: email to support team
*/ */
$mail->addAddress(MAIL_SUPPORT); $mail->addAddress(MAIL_SUPPORT);
$mail->addReplyTo($sender, $sendername);
$mail->Subject = "New Card Issue Notification"; $mail->Subject = "New Card Issue Notification";
$mail->Body = "<html>" $mail->Body = "<html>"
."<head><title>mail2deck response</title></head>" ."<head><title>mail2deck response</title></head>"