@@ 52-64 (lines=13) @@ | ||
49 | $swift_message->addPart($message->getHtml(), 'text/html'); |
|
50 | ||
51 | // Attachments |
|
52 | foreach ($message->getAttachments() as $attachment) { |
|
53 | list($file, $options) = $attachment; |
|
54 | ||
55 | $content_type = empty($options['content-type']) ? null : $options['content-type']; |
|
56 | ||
57 | $attachment = Swift_Attachment::fromPath($file, $content_type); |
|
58 | ||
59 | if (!empty($options['filename'])) { |
|
60 | $attachment->setFilename($options['filename']); |
|
61 | } |
|
62 | ||
63 | $swift_message->attach($attachment); |
|
64 | } |
|
65 | ||
66 | // Inline attachments |
|
67 | foreach ($message->getInlines() as $inline) { |
|
@@ 67-79 (lines=13) @@ | ||
64 | } |
|
65 | ||
66 | // Inline attachments |
|
67 | foreach ($message->getInlines() as $inline) { |
|
68 | list($file, $options) = $inline; |
|
69 | ||
70 | $content_type = empty($options['content-type']) ? null : $options['content-type']; |
|
71 | ||
72 | $attachment = Swift_EmbeddedFile::fromPath($file, $content_type); |
|
73 | ||
74 | if (!empty($options['filename'])) { |
|
75 | $attachment->setFilename($options['filename']); |
|
76 | } |
|
77 | ||
78 | $swift_message->embed($attachment); |
|
79 | } |
|
80 | ||
81 | // Send ! |
|
82 | $this->swift->send($swift_message); |