How to use the masonite.managers.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_managers_mail_manager.py View on Github external
def test_send_mail_with_subject(self):
        self.app.bind('MailSmtpDriver', MailDriver)

        self.assertEqual(MailManager(self.app).driver('smtp').to('').subject('test').message_subject, 'test')
github MasoniteFramework / masonite / tests / core / test_managers_mail_manager.py View on Github external
def test_mail_manager_loads_container(self):
        mailManager = MailManager(self.app)
        self.assertTrue(mailManager.load_container(self.app))
github MasoniteFramework / masonite / tests / core / test_managers_mail_manager.py View on Github external
def test_send_mail(self):
        self.app.bind('MailSmtpDriver', MailDriver)
        self.assertTrue(MailManager(self.app).driver('smtp').to('idmann509@gmail.com'))
github MasoniteFramework / masonite / tests / test_managers_mail_manager.py View on Github external
def test_switch_mail_manager(self):
        self.app.bind('MailSmtpDriver', MailDriver)
        self.app.bind('MailTestDriver', Mailgun)

        mail_driver = MailManager(self.app).driver('smtp')

        assert isinstance(mail_driver.driver('test'), Mailgun)
github MasoniteFramework / masonite / tests / core / test_managers_mail_manager.py View on Github external
def test_send_mail_with_from(self):
        self.app.bind('MailSmtpDriver', MailDriver)

        self.assertEqual(MailManager(self.app).driver('smtp').to('idmann509@gmail.com').send_from('masonite@masonite.com').from_address, 'masonite@masonite.com')
github MasoniteFramework / masonite / tests / test_managers_mail_manager.py View on Github external
def test_send_mail_with_callable(self):
        self.app.bind('MailSmtpDriver', MailDriver)
        user = User
        user.email = 'email@email.com'
        assert MailManager(self.app).driver('smtp').to(User)
github MasoniteFramework / masonite / tests / core / test_managers_mail_manager.py View on Github external
def test_does_not_raise_drivernotfound_exception(self):
        MailManager(self.app)
github MasoniteFramework / masonite / tests / core / test_managers_mail_manager.py View on Github external
def test_driver_loads_template(self):
        self.app.bind('MailSmtpDriver', MailDriver)

        driver = MailManager(self.app).driver('smtp')

        self.assertEqual(driver.template('test', {'test': 'test'}).message_body, 'test')
github MasoniteFramework / masonite / masonite / providers / HelpersProvider.py View on Github external
def boot(self, view: View, request: Request):
        """Add helper functions to Masonite."""
        builtins.view = view.render
        builtins.request = request.helper
        builtins.auth = request.user
        builtins.container = self.app.helper
        builtins.env = os.getenv
        builtins.resolve = self.app.resolve
        builtins.route = request.route
        if self.app.has(MailManager):
            builtins.mail_helper = self.app.make(MailManager).helper
        builtins.dd = DD(self.app).dump

        view.share(
            {
                'request': request.helper,
                'auth': request.user,
                'request_method': set_request_method,
                'route': request.route,
                'back': back,
                'sign': sign,
                'unsign': unsign,
                'decrypt': decrypt,
                'encrypt': encrypt,
                'config': config,
                'optional': optional,
                'dd': builtins.dd,
github MasoniteFramework / masonite / masonite / providers / MailProvider.py View on Github external
def register(self):
        from config import mail
        self.app.bind('MailConfig', mail)
        self.app.bind('MailSmtpDriver', MailSmtpDriver)
        self.app.bind('MailMailgunDriver', MailMailgunDriver)
        self.app.bind('MailLogDriver', MailLogDriver)
        self.app.bind('MailTerminalDriver', MailTerminalDriver)
        self.app.bind('MailManager', MailManager(self.app))