From a95158f3df244069f6080608bd3b4d728160def1 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Fri, 8 Jul 2022 22:38:32 +0530 Subject: [PATCH] fix: Gite credentials email: fix subject and let user know instance is being provisioned fixes: https://gitea.hostea.org/Hostea/dashboard/issues/44 --- billing/tests.py | 2 +- .../templates/infrastructure/emails/gitea-creds.txt | 11 +++++++---- infrastructure/views.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/billing/tests.py b/billing/tests.py index 54cf554..071764a 100644 --- a/billing/tests.py +++ b/billing/tests.py @@ -114,7 +114,7 @@ class BillingTest(TestCase): all( [ instance_notificaiton.to[0] == self.email, - "Congratulations on your new Gitea instance!" + "Congratulations on your new Hostea instance!" in instance_notificaiton.body, ] ), diff --git a/infrastructure/templates/infrastructure/emails/gitea-creds.txt b/infrastructure/templates/infrastructure/emails/gitea-creds.txt index 77e55c3..532a429 100644 --- a/infrastructure/templates/infrastructure/emails/gitea-creds.txt +++ b/infrastructure/templates/infrastructure/emails/gitea-creds.txt @@ -1,11 +1,14 @@ Hello {{ username }}, -Congratulations on your new Gitea instance! +Congratulations on your new Hostea instance! + +Your Hostea instance is being prepared, you will receive an email +notification when it is ready. You can use the following credentials to log into an admin account on -your new Gitea instance. Great powers come with great responsibilities, -so use the admin credentials wisely. When in doubt, consult the Gitea -docs or contact support! +your new Hostea Gitea instance. Great powers come with great +responsibilities, so use the admin credentials wisely. When in doubt, +consult the Gitea docs or contact support! - username : root - password: {{ gitea_password }} diff --git a/infrastructure/views.py b/infrastructure/views.py index 20500d6..91c3695 100644 --- a/infrastructure/views.py +++ b/infrastructure/views.py @@ -69,7 +69,7 @@ def create_instance(request, instance_name: str): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Your Hostea instance is now online!", + subject="[Hostea] Gitea admin credentials", message=body, from_email=f"No reply Hostea<{sender}>", # TODO read from settings.py recipient_list=[request.user.email],