Skip to content
Snippets Groups Projects
Commit 85b73061 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Use sg_mail method to add file attachments

parent 1c3867bb
No related branches found
No related tags found
No related merge requests found
...@@ -317,32 +317,25 @@ class JoblistController extends ActionController { ...@@ -317,32 +317,25 @@ class JoblistController extends ActionController {
} }
} }
$mailService->setMarkers(['application' => $applyData]); $mailService->setMarkers([
'application' => $applyData,
]);
$mailService->setIgnoreMailQueue(TRUE); $mailService->setIgnoreMailQueue(TRUE);
// add attachments for each file // add attachments for each file
$coverLetter = $applyData->getCoverLetter(); $coverLetter = $applyData->getCoverLetter();
if ($coverLetter) { if ($coverLetter) {
$originalResource = $coverLetter->getOriginalResource(); $mailService->addFileResourceAttachment($coverLetter);
if ($originalResource) {
$this->addAttachmentsToMail($originalResource, $mailService);
}
} }
$cv = $applyData->getCv(); $cv = $applyData->getCv();
if ($cv) { if ($cv) {
$originalResource = $cv->getOriginalResource(); $mailService->addFileResourceAttachment($cv);
if ($originalResource) {
$this->addAttachmentsToMail($originalResource, $mailService);
}
} }
$certificate = $applyData->getCertificate(); $certificate = $applyData->getCertificate();
if ($certificate) { if ($certificate) {
$originalResource = $certificate->getOriginalResource(); $mailService->addFileResourceAttachment($certificate);
if ($originalResource) {
$this->addAttachmentsToMail($originalResource, $mailService);
}
} }
$mailService->sendEmail(); $mailService->sendEmail();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment