How to use the masonite.managers.MailManager.MailManager function in masonite

To help you get started, we’ve selected a few masonite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MasoniteFramework / masonite / tests / core / test_mail_smtp_driver.py View on Github external
def test_works(self):
        mailable = MailManager(self.container).driver('smtp').mailable(ForgotPasswordMailable())
        self.assertEqual(mailable.to_address, 'idmann509@gmail.com')
        self.assertEqual(mailable.from_address, 'admin@test.com')
        self.assertEqual(mailable.message_subject, 'Forgot Password')
        self.assertEqual(mailable.message_body, 'testing email')
        self.assertEqual(mailable.message_reply_to, 'customer@email.com')
        self.assertTrue(True)
github MasoniteFramework / masonite / tests / core / test_mail_log_drivers.py View on Github external
def test_terminal_mail_renders_template(self):

        self.assertIn('MasoniteTesting', MailManager(self.app).driver('terminal').to(
            'idmann509@gmail.com').template('mail/welcome', {'to': 'MasoniteTesting'}).message_body)
github MasoniteFramework / masonite / tests / core / test_mail_smtp_driver.py View on Github external
def test_mail_sends_with_queue_and_without_queue(self):
        if env('RUN_MAIL'):
            self.assertEqual(MailManager(self.app).driver('smtp').to('idmann509@gmail.com').send('test queue'), None)
            self.assertEqual(MailManager(self.app).driver('smtp').queue().to('idmann509@gmail.com').send('test queue'), None)
github MasoniteFramework / masonite / tests / core / test_mail_log_drivers.py View on Github external
def test_terminal_driver_output(self):
        user = UserMock
        user.email = 'test@email.com'
        with captured_output() as (_, err):
            MailManager(self.app).driver('terminal').to(user).reply_to('reply-to@email.com').send('Masonite')

        # This can go inside or outside the `with` block
        error = err.getvalue().strip()
        self.assertIn('test@email.com', error)
        self.assertIn('reply-to@email.com', error)
github MasoniteFramework / masonite / tests / core / test_mailgun_driver.py View on Github external
def test_mail_sends_with_queue_and_without_queue(self):
            if env('RUN_MAIL'):
                self.assertEqual(MailManager(self.app).driver('mailgun').to('idmann509@gmail.com').send('test queue'), None)
                self.assertEqual(MailManager(self.app).driver('mailgun').queue().to('idmann509@gmail.com').send('test queue'), None)
github MasoniteFramework / masonite / tests / core / test_mail_log_drivers.py View on Github external
def test_log_mail_renders_template(self):

        self.assertIn('MasoniteTesting', MailManager(self.app).driver('log').to(
            'idmann509@gmail.com').template('mail/welcome', {'to': 'MasoniteTesting'}).message_body)
github MasoniteFramework / masonite / tests / core / test_mail_log_drivers.py View on Github external
def test_log_driver(self):
        user = UserMock
        user.email = 'test@email.com'

        self.assertEqual(MailManager(self.app).driver('log').to(user).to_address, 'test@email.com')
github MasoniteFramework / masonite / tests / core / test_mailgun_driver.py View on Github external
def test_mailgun_driver(self):
            user = UserMock
            user.email = 'test@email.com'

            self.assertEqual(MailManager(self.app).driver('mailgun').to(user).to_address, 'test@email.com')
            self.assertEqual(MailManager(self.app).driver('mailgun').reply_to('reply_to@email.com').message_reply_to , 'reply_to@email.com')
github MasoniteFramework / masonite / tests / core / test_mail_smtp_driver.py View on Github external
def test_smtp_driver(self):
        user = UserMock
        user.email = 'test@email.com'

        self.assertEqual(MailManager(self.app).driver('smtp').to(user).to_address, 'test@email.com')
        self.assertEqual(MailManager(self.app).driver('smtp').reply_to('reply_to@email.com').message_reply_to , 'reply_to@email.com')
github MasoniteFramework / masonite / tests / queues / test_redis_driver.py View on Github external
def test_redis_driver():
    container = TestSuite().create_container().container

    container.bind('Container', container)
    container.bind('Test', 'Test')
    container.bind('Mail', MailManager(container))
    container.bind('QueueConfig', queue)
    container.bind('QueueRedisDriver', QueueRedisDriver)
    container.bind('QueueAsyncDriver', QueueAsyncDriver)
    container.bind('QueueManager', QueueManager(container))
    container.bind('MailConfig', mail)
    container.bind('MailSmtpDriver', MailManager(container).driver('smtp'))

    manager = container.make('QueueManager').driver('async')