fix: mail priority

This commit is contained in:
Maël Gangloff
2025-01-23 00:31:37 +01:00
parent 4f4d18c816
commit 01f1fac357
7 changed files with 51 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Notifier;
use App\Entity\Domain;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\EmailMessage;
use Symfony\Component\Notifier\Message\PushMessage;
@@ -48,6 +49,7 @@ class DomainDeletedNotification extends DomainWatchdogNotification
return new EmailMessage((new TemplatedEmail())
->from($this->sender)
->to($recipient->getEmail())
->priority(Email::PRIORITY_HIGHEST)
->subject("Domain name $ldhName has been removed from WHOIS")
->htmlTemplate('emails/errors/domain_deleted.html.twig')
->locale('en')

View File

@@ -5,6 +5,7 @@ namespace App\Notifier;
use App\Entity\Domain;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\EmailMessage;
use Symfony\Component\Notifier\Message\PushMessage;
@@ -48,6 +49,7 @@ class DomainOrderErrorNotification extends DomainWatchdogNotification
return new EmailMessage((new TemplatedEmail())
->from($this->sender)
->to($recipient->getEmail())
->priority(Email::PRIORITY_HIGH)
->subject("Domain name $ldhName tried to be purchased")
->htmlTemplate('emails/errors/domain_order.html.twig')
->locale('en')

View File

@@ -30,7 +30,7 @@ class DomainOrderNotification extends DomainWatchdogNotification
$this
->subject("Success: Domain Ordered $ldhName!")
->content("Domain name $ldhName has just been purchased. The API provider did not return an error.")
->importance(Notification::IMPORTANCE_HIGH);
->importance(Notification::IMPORTANCE_URGENT);
return ChatMessage::fromNotification($this);
}
@@ -41,7 +41,7 @@ class DomainOrderNotification extends DomainWatchdogNotification
$this
->subject("Success: Domain Ordered $ldhName!")
->content("Domain name $ldhName has just been purchased. The API provider did not return an error.")
->importance(Notification::IMPORTANCE_HIGH);
->importance(Notification::IMPORTANCE_URGENT);
return PushMessage::fromNotification($this);
}

View File

@@ -5,6 +5,7 @@ namespace App\Notifier;
use App\Entity\Domain;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\EmailMessage;
use Symfony\Component\Notifier\Message\PushMessage;
@@ -48,6 +49,7 @@ class DomainUpdateErrorNotification extends DomainWatchdogNotification
return new EmailMessage((new TemplatedEmail())
->from($this->sender)
->to($recipient->getEmail())
->priority(Email::PRIORITY_NORMAL)
->subject("Domain name $ldhName tried to be updated")
->htmlTemplate('emails/errors/domain_update.html.twig')
->locale('en')

View File

@@ -51,7 +51,7 @@ class DomainUpdateNotification extends DomainWatchdogNotification
return new EmailMessage((new TemplatedEmail())
->from($this->sender)
->to($recipient->getEmail())
->priority(Email::PRIORITY_HIGHEST)
->priority(Email::PRIORITY_HIGH)
->subject("Domain name $ldhName information has been updated")
->htmlTemplate('emails/success/domain_updated.html.twig')
->locale('en')

View File

@@ -5,6 +5,7 @@ namespace App\Notifier;
use App\Entity\Connector;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Notifier\Message\EmailMessage;
use Symfony\Component\Notifier\Notification\Notification;
use Symfony\Component\Notifier\Recipient\EmailRecipientInterface;
@@ -23,6 +24,7 @@ class ValidateConnectorCredentialsErrorNotification extends Notification
return new EmailMessage((new TemplatedEmail())
->from($this->sender)
->to($recipient->getEmail())
->priority(Email::PRIORITY_HIGH)
->subject('Connector credentials error')
->htmlTemplate('emails/errors/connector_credentials.html.twig')
->locale('en')