From b28cbd80e0cd9e006e3a370c13dfd84128d63bc9 Mon Sep 17 00:00:00 2001 From: Marick Date: Tue, 24 Jul 2018 18:53:19 +0200 Subject: [PATCH 1/3] make sure attributes are always decrypted --- src/Email.php | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/src/Email.php b/src/Email.php index b90cf61..d9f8cc5 100644 --- a/src/Email.php +++ b/src/Email.php @@ -85,16 +85,37 @@ 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 +158,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 +178,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 +198,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 +228,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 +248,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. * From b0a1e984551a115ba19349e87284d50cae9ceea3 Mon Sep 17 00:00:00 2001 From: Marick Date: Tue, 24 Jul 2018 19:03:29 +0200 Subject: [PATCH 2/3] styleci --- src/Email.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Email.php b/src/Email.php index d9f8cc5..8512a28 100644 --- a/src/Email.php +++ b/src/Email.php @@ -86,7 +86,6 @@ public function getRecipient() } /** - * * Get the e-mail recipient. * * @return string From 4a35677339ce3be355781afc211d6c274a9e9262 Mon Sep 17 00:00:00 2001 From: Marick Date: Tue, 24 Jul 2018 19:31:44 +0200 Subject: [PATCH 3/3] fix tests --- src/Email.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Email.php b/src/Email.php index 8512a28..ee0a2b5 100644 --- a/src/Email.php +++ b/src/Email.php @@ -463,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, @@ -476,7 +475,7 @@ public function retry() 'sent_at' => null, 'delivered_at' => null, ] - )); + ); $retry->save(); }