Created
October 23, 2020 17:34
-
-
Save JMIdeaMaker/c34b4034139f556de9e34cc7f3d6bb82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
from django.core.mail import send_mail | |
class Command(BaseCommand): | |
help = 'Sends a test email to specified input email' | |
def add_arguments(self, parser): | |
parser.add_argument('email', type=str) | |
def handle(self, *args, **options): | |
email = options.get('email', None) | |
send_mail( | |
'Test Subject', | |
'Test Message', | |
'noreply@djscaffold.com', | |
[email], | |
fail_silently=False, | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment