From b20f1abb77d9c3450f601f703f6f6be9cf2dd65f Mon Sep 17 00:00:00 2001 From: androiddrew Date: Mon, 14 May 2018 21:47:57 -0400 Subject: [PATCH] Updated usage instructions --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a671f88..541f0e5 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,11 @@ Provides a simple interface to set up SMTP with your [APIStar](https://github.co ### Example Setup -To send mail messages from your view functions you must include a dictionary of mail options to the `MailComponent. Here we have a minimally viable app capable of sending an email message and returning a 204 response code: +To send mail messages from your view functions you must include a dictionary of mail options to the `MailComponent`. Here we have a minimally viable app capable of sending an email message and returning a 204 response code: ```python from apistar import App, Route +from apistar.http import Response from apistar_mail import MailComponent, Mail, Message mail_options = { @@ -34,11 +35,11 @@ mail_options = { def send_a_message(mail: Mail): - msg = Message('Hello', - sender='me@example.com', + msg = Message(subject='Hello', + body='Welcome to APIStar!', recipients=['you@example.com']) mail.send(msg) - return + return Response('', 204) routes = [