fix: show article name and admin link in stock alert email
Fix ``AlerteStock`` to use ``name`` instead of non-existent ``title`` field on articles, so the article name actually appears in the email. Add ``lien_article`` variable with a direct link to the admin article edit page. Update the DB template with a button and text link.
This commit is contained in:
@@ -23,14 +23,20 @@ class AlerteStock extends TemplateMailable
|
||||
|
||||
public $seuil;
|
||||
|
||||
public $lien_article;
|
||||
|
||||
public $lien_offre;
|
||||
|
||||
protected static $templateModelClass = MailTemplate::class;
|
||||
|
||||
public function __construct($offer)
|
||||
{
|
||||
$this->article = $offer->article->title ?? 'Article #'.$offer->article_id;
|
||||
$this->article = $offer->article->name ?? 'Article #'.$offer->article_id;
|
||||
$this->offre = $offer->id;
|
||||
$this->stock_restant = $offer->stock_current;
|
||||
$this->seuil = $offer->minimum_ondemand;
|
||||
$this->lien_article = url('/Admin/Shop/Articles/edit/'.$offer->article_id);
|
||||
$this->lien_offre = url('/Admin/Shop/Offers/edit/'.$offer->id);
|
||||
}
|
||||
|
||||
public function envelope()
|
||||
|
||||
Reference in New Issue
Block a user