name = $filename; return $this; } /** * @return $this * @since 13.0.0 */ public function setContentType(string $contentType): IAttachment { $this->contentType = $contentType; return $this; } /** * @return $this * @since 13.0.0 */ public function setBody(string $body): IAttachment { $this->body = $body; return $this; } public function attach(Email $symfonyEmail): void { if ($this->path !== null) { $symfonyEmail->attachFromPath($this->path, $this->name, $this->contentType); } else { $symfonyEmail->attach($this->body, $this->name, $this->contentType); } } }