Skip to content
Code-Schnipsel Gruppen Projekte
Commit 8f5b69b9 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: multiple attachments for the order mails

Übergeordneter 7a6ec85c
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -619,6 +619,10 @@
<de><![CDATA[Widerrufsrecht]]></de>
<en><![CDATA[Cancellation Policy]]></en>
</locale>
<locale name="order.settings.mails.attachments">
<de><![CDATA[Dateianhänge]]></de>
<en><![CDATA[File attachments]]></en>
</locale>
<locale name="order.settings.failedPaymentProcedure,execute">
<de><![CDATA[Bestellung ausführen]]></de>
......
......@@ -42,14 +42,20 @@
<conf name="privacyPolicy">
<type><![CDATA[string]]></type>
</conf>
<!-- AGB -->
<conf name="termsAndConditions">
<type><![CDATA[string]]></type>
</conf>
<!-- Cancellation policy -->
<conf name="cancellationPolicy">
<type><![CDATA[string]]></type>
</conf>
<conf name="attachments">
<type><![CDATA[string]]></type>
</conf>
</section>
<section name="orderStatus">
......@@ -249,7 +255,15 @@
<locale group="quiqqer/order" var="order.settings.mails.cancellationPolicy"/>
</text>
</input>
<input type="text"
data-qui="controls/projects/project/media/Select"
data-qui-options-multiple="1"
conf="mails.attachments"
>
<text>
<locale group="quiqqer/order" var="order.settings.mails.attachments"/>
</text>
</input>
</settings>
<settings title="orderStatusSettings" name="orderStatusSettings">
......
......@@ -280,6 +280,7 @@ protected static function addOrderMailAttachments(QUI\Mail\Mailer $Mail)
$privacyPolicy = (int)$Config->getValue('mails', 'privacyPolicy');
$termsAndConditions = (int)$Config->getValue('mails', 'termsAndConditions');
$cancellationPolicy = (int)$Config->getValue('mails', 'cancellationPolicy');
$attachments = $Config->getValue('mails', 'attachments');
if ($privacyPolicy) {
try {
......@@ -316,6 +317,20 @@ protected static function addOrderMailAttachments(QUI\Mail\Mailer $Mail)
} catch (QUI\Exception $Exception) {
}
}
if (!empty($attachments)) {
$attachments = explode(',', $attachments);
$Media = QUI::getProjectManager()->getStandard()->getMedia();
foreach ($attachments as $attachment) {
try {
$Item = $Media->get($attachment);
$Mail->addAttachment($Item->getFullPath());
} catch (\Exception $Exception) {
QUI\System\Log::addAlert('Order mail attachment file error :: '.$Exception->getMessage());
}
}
}
}
/**
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren