from email.mime.text import MIMEText import email.utils import smtplib import sys # Arguments passed from PlexPy # {show_name} {episode_name} {season_num00} {episode_num00} {server_name} {media_type} {poster_url} {title} {summary} {library_name} show_name = sys.argv[1] # You can add more arguments if you want more details in the email body episode_name = sys.argv[2] season_num = sys.argv[3] episode_num = sys.argv[4] plex_server = sys.argv[5] show_type = sys.argv[6] poster = sys.argv[7] title = sys.argv[8] summary = sys.argv[9] library_name = sys.argv[10] show_list = ["Show", "Another Show"] # Add shows to list that you want notification for. show_notify = '' for n in show_list: if n == show_name: show_notify = n # Email settings name = 'PlexPy' # Your name sender = 'sender' # From email address to = 'reciever' # To email address email_server = 'smtp.gmail.com' # Email server (Gmail: smtp.gmail.com) email_port = 587 # Email port (Gmail: 587) email_username = 'email' # Your email username email_password = 'password' # Your email password email_subject = 'New episode for ' + show_name + ' is available on ' + plex_server # The email subject # More detailed email body show_html = """\
Hi!
%s S%s - E%s -- %s -- was recently added to %s on PLEX
%s