Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Support SwiftMailer 6.x #113

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Classes/Finishers/EmailFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* - carbonCopyAddress: Email address of the copy recipient (use multiple addresses with an array)
* - blindCarbonCopyAddress: Email address of the blind copy recipient (use multiple addresses with an array)
* - format: format of the email (one of the FORMAT_* constants). By default mails are sent as HTML
* - attachAllPersistentResources: if TRUE all FormElements that are converted to a PersistendResource (e.g. the FileUpload element) are added to the mail as attachments
* - attachAllPersistentResources: if TRUE all FormElements that are converted to a PersistentResource (e.g. the FileUpload element) are added to the mail as attachments
* - attachments: array of explicit files to be attached. Every item in the array has to be either "resource" being the path to a file, or "formElement" referring to the identifier of an Form Element that contains the PersistentResource to attach. This can be combined with the "attachAllPersistentResources" option
* - testMode: if TRUE the email is not actually sent but outputted for debugging purposes. Defaults to FALSE
*/
Expand Down Expand Up @@ -209,7 +209,7 @@ protected function addAttachments(SwiftMailerMessage $mail)
if ($this->parseOption('attachAllPersistentResources')) {
foreach ($formValues as $formValue) {
if ($formValue instanceof PersistentResource) {
$mail->attach(\Swift_Attachment::newInstance(stream_get_contents($formValue->getStream()), $formValue->getFilename(), $formValue->getMediaType()));
$mail->attach(new \Swift_Attachment(stream_get_contents($formValue->getStream()), $formValue->getFilename(), $formValue->getMediaType()));
}
}
}
Expand All @@ -227,7 +227,7 @@ protected function addAttachments(SwiftMailerMessage $mail)
if (!$resource instanceof PersistentResource) {
continue;
}
$mail->attach(\Swift_Attachment::newInstance(stream_get_contents($resource->getStream()), $resource->getFilename(), $resource->getMediaType()));
$mail->attach(new \Swift_Attachment(stream_get_contents($resource->getStream()), $resource->getFilename(), $resource->getMediaType()));
}
}
}
Expand Down