Skip to content
Snippets Groups Projects
Unverified Commit 46904968 authored by Torma Kristóf's avatar Torma Kristóf :alien:
Browse files

add a command

parent 9c887937
No related branches found
No related tags found
No related merge requests found
Pipeline #43308 passed
......@@ -36,6 +36,11 @@ def send_out_mail(subject, message, SENDER_EMAIL, receiver_email):
email.send()
@shared_task
def send_out_mail_task(subject, message, SENDER_EMAIL, receiver_email):
send_out_mail(subject, message, SENDER_EMAIL, receiver_email)
@shared_task()
def registration(user):
subject = "KSZKépzés regisztráció"
......
from django.core.management.base import BaseCommand, CommandError
from common.email import send_out_mail_task
class Command(BaseCommand):
help = 'Sends an email'
def add_arguments(self, parser):
parser.add_argument('subject', type=str)
parser.add_argument('message', type=str)
parser.add_argument('SENDER_EMAIL', type=str)
parser.add_argument('receiver_email', type=str)
def handle(self, *args, **options):
send_out_mail_task.delay(options['subject'], options['message'], options['SENDER_EMAIL'], options['receiver_email'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment