Skip to content

Commit

Permalink
added docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Dec 3, 2018
1 parent a234c33 commit 624a6f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion masonite/drivers/MailMailgunDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ def send(self, message=None):


def _send_mail(self, message):
"""Wrapper around sending mail so it can also be used with queues.
Arguments:
message {string|None} -- The message to be sent passed in from the send method.
Returns:
requests.post
"""
if not message:
message = self.message_body

domain = self.config.DRIVERS['mailgun']['domain']
secret = self.config.DRIVERS['mailgun']['secret']

return requests.post(
"https://api.mailgun.net/v3/{0}/messages".format(domain),
auth=("api", secret),
Expand Down
2 changes: 2 additions & 0 deletions masonite/drivers/MailSmtpDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ def send(self, message_contents=None):
self.smtp.quit()

def _send_mail(self, *args):
"""Wrapper around sending mail so it can also be used for queues.
"""
self.smtp.sendmail(*args)
self.smtp.quit()

0 comments on commit 624a6f6

Please sign in to comment.