diff --git a/src/Email.php b/src/Email.php index b90cf61..ee0a2b5 100644 --- a/src/Email.php +++ b/src/Email.php @@ -85,16 +85,36 @@ public function getRecipient() return $this->recipient; } + /** + * Get the e-mail recipient. + * + * @return string + */ + public function getRecipientAttribute() + { + return $this->recipient; + } + /** * Get the e-mail from. * - * @return array + * @return string */ public function getFrom() { return $this->from; } + /** + * Get the e-mail from. + * + * @return string + */ + public function getFromAttribute() + { + return $this->from; + } + /** * Get the e-mail from address. * @@ -137,6 +157,16 @@ public function getCc() return $this->cc; } + /** + * Get the e-mail CC addresses. + * + * @return array + */ + public function getCcAttribute() + { + return $this->cc; + } + /** * Get the e-mail BCC addresses. * @@ -147,6 +177,16 @@ public function getBcc() return $this->bcc; } + /** + * Get the e-mail BCC addresses. + * + * @return array + */ + public function getBccAttribute() + { + return $this->bcc; + } + /** * Get the e-mail subject. * @@ -157,6 +197,16 @@ public function getSubject() return $this->subject; } + /** + * Get the e-mail subject. + * + * @return string + */ + public function getSubjectAttribute() + { + return $this->view; + } + /** * Get the e-mail view. * @@ -177,6 +227,16 @@ public function getVariables() return $this->variables; } + /** + * Get the e-mail variables. + * + * @return array + */ + public function getVariablesAttribute() + { + return $this->variables; + } + /** * Get the e-mail body. * @@ -187,6 +247,16 @@ public function getBody() return $this->body; } + /** + * Get the e-mail body. + * + * @return string + */ + public function getBodyAttribute() + { + return $this->body; + } + /** * Get the e-mail attachments. * @@ -393,10 +463,9 @@ public function send() */ public function retry() { - $retry = new static; + $retry = $this->replicate(); - $retry->fill(array_merge( - $this->toArray(), + $retry->fill( [ 'id' => null, 'attempts' => 0, @@ -406,7 +475,7 @@ public function retry() 'sent_at' => null, 'delivered_at' => null, ] - )); + ); $retry->save(); }