Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Sep 13, 2024
2 parents be79c69 + 9d7b5e9 commit 4f34208
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/Models/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,27 @@ public function scopeUnsent(Builder $query): Builder
{
return $query->whereNull('sent_at');
}
}

public function getStatusAttribute(): string
{
if ($this->hard_bounced_at) {
return __('Hard Bounced');
} elseif ($this->soft_bounced_at) {
return __('Soft Bounced');
} elseif ($this->complained_at) {
return __('Complained');
} elseif ($this->last_clicked_at) {
return __('Clicked');
} elseif ($this->last_opened_at) {
return __('Opened');
} elseif ($this->delivered_at) {
return __('Delivered');
} elseif ($this->resent_at) {
return __('Resent');
} elseif ($this->sent_at) {
return __('Sent');
} else {
return __('Unsent');
}
}
}

0 comments on commit 4f34208

Please sign in to comment.