exception example

->text($notification->getContent() ?: $notification->getSubject())
            ;
        } else {
            $email = (new NotificationEmail())
                ->to($recipient->getEmail())
                ->subject($notification->getSubject())
                ->content($notification->getContent() ?: $notification->getSubject())
                ->importance($notification->getImportance())
            ;

            if ($exception = $notification->getException()) {
                $email->exception($exception);
            }
        }

        $message = new self($email);
        $message->notification = $notification;

        return $message;
    }

    public function getMessage(): RawMessage
    {
        
public function __construct(string $subject = '', array $channels = [])
    {
        $this->subject = $subject;
        $this->channels = $channels;
    }

    /** * @param list<string> $channels */
    public static function fromThrowable(\Throwable $exception, array $channels = []): self
    {
        return (new self('', $channels))->exception($exception);
    }

    /** * @return $this */
    public function subject(string $subject)static
    {
        $this->subject = $subject;

        return $this;
    }

    
namespace Symfony\Bridge\Twig\Tests\Mime;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Twig\Mime\NotificationEmail;

class NotificationEmailTest extends TestCase
{
    public function test()
    {
        $email = (new NotificationEmail())
            ->markdown('Foo')
            ->exception(new \Exception())
            ->importance(NotificationEmail::IMPORTANCE_HIGH)
            ->action('Bar', 'http://example.com/')
            ->context(['a' => 'b'])
        ;

        $this->assertEquals([
            'importance' => NotificationEmail::IMPORTANCE_HIGH,
            'content' => 'Foo',
            'exception' => true,
            'action_text' => 'Bar',
            'action_url' => 'http://example.com/',
            
Home | Imprint | This part of the site doesn't use cookies.