-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from intuitem/resend_mail
Resend welcome or reset mail
- Loading branch information
Showing
2 changed files
with
40 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 reset email" | ||
|
||
def handle(self, *args, **kwargs): | ||
admin = User.objects.get(email=CISO_ASSISTANT_SUPERUSER_EMAIL) | ||
print(admin) | ||
try: | ||
admin.mailing( | ||
email_template_name="registration/password_reset_email.html", | ||
subject="CISO Assistant: Password Reset", | ||
) | ||
self.stdout.write("reset mail sent") | ||
except Exception as e: | ||
self.stdout.write("cannot send reset mail") |
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") |