Skip to content

Commit

Permalink
feat: mail provider backend
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Sep 5, 2024
1 parent c119ff7 commit d423edb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/Provider/Command/MessageSend.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,11 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar
foreach ($message->getAttachments() as $entry) {
// convert mail provider attachment to mail app attachment
try {
$name = $entry->getName();
$type = $entry->getType();
$contents = $entry->getContents();

$attachments[] = $this->attachmentService->addFileFromString(
$userId,
$name,
$type,
$contents
(string)$entry->getName(),
(string)$entry->getType(),
(string)$entry->getContents()
)->jsonSerialize();
} catch (\Throwable $e) {
throw new SendException('Error: occurred while saving mail message attachment', 0, $e);
Expand Down Expand Up @@ -135,7 +131,7 @@ public function perform(string $userId, string $serviceId, IMessage $message, ar
*
* @param array<int,IAddress> $addresses collection of IAddress objects
*
* @return array<int,array{email?: string, label?: string}>
* @return array<int, array{email: ?string, label?: ?string}>
*/
protected function convertAddressArray(array $addresses): array {
return array_map(static function (IAddress $address) {
Expand Down

0 comments on commit d423edb

Please sign in to comment.