-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3298f91
commit d0157dd
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.core.management.base import BaseCommand | ||
from core.models import * | ||
from iam.models import User, Folder | ||
from ciso_assistant.settings import CISO_ASSISTANT_SUPERUSER_EMAIL | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Send welcome email" | ||
|
||
def handle(self, *args, **kwargs): | ||
admin = User.objects.get(email=CISO_ASSISTANT_SUPERUSER_EMAIL) | ||
print(admin) | ||
try: | ||
admin.mailing( | ||
email_template_name="registration/first_connexion_email.html", | ||
subject="Welcome to CISO Assistant!", | ||
) | ||
self.stdout.write("welcome mail sent") | ||
except Exception as e: | ||
self.stdout.write("cannot send welcome mail") |