library/library/emails.py

35 lines
1009 B
Python

def format_reminder_email(quest_id: str,
days_signed_out: int,
librarian_name: str,
book_name) -> str:
"""
Formats an email as a plain string for sending out email reminders
for signed out books.
Example: _send_email("s455wang", "2017-02-04", 30, "csfmurph", "How to Design Programs")
"""
email_message_body = \
"""Hi {},
Our records indicate that you have had the book {} signed out for {} days.
Please return the book to the CS Club office (MC 3036) at your earliest convenience.
Thanks,
{}
Computer Science Club | University of Waterloo
librarian@csclub.uwaterloo.ca""".format(
quest_id,
book_name,
days_signed_out,
librarian_name
)
email_message_subject = "Overdue book: {}".format(book_name)
email_message = "Subject: {}\n\n{}".format(email_message_subject,
email_message_body)
return email_message