From 51e7ea4d5ef6f3ce097e63ab8f492b0ff74f45b1 Mon Sep 17 00:00:00 2001 From: Hostea dashboard Date: Mon, 12 Sep 2022 16:36:29 +0530 Subject: [PATCH 1/3] fix: rename Gna! in emails --- accounts/utils.py | 12 ++++++------ billing/templates/billing/emails/payment-receipt.txt | 6 +++--- billing/views.py | 4 ++-- infrastructure/utils.py | 4 ++-- infrastructure/views.py | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/accounts/utils.py b/accounts/utils.py index df0a5fe..043a5c3 100644 --- a/accounts/utils.py +++ b/accounts/utils.py @@ -45,9 +45,9 @@ def send_password_changed_email(request): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Password changed", + subject="[Gna!] Password changed", message=body, - from_email=f"No reply Hostea<{sender}>", + from_email=f"No reply Gna!<{sender}>", recipient_list=[email], ) @@ -72,9 +72,9 @@ def send_password_reset_email(request, challenge): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Password reset link", + subject="[Gna!] Password reset link", message=body, - from_email=f"No reply Hostea<{sender}>", + from_email=f"No reply Gna!<{sender}>", recipient_list=[email], ) @@ -99,9 +99,9 @@ def send_verification_email(request, challenge): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Please confirm your email address", + subject="[Gna!] Please confirm your email address", message=body, - from_email=f"No reply Hostea<{sender}>", + from_email=f"No reply Gna!<{sender}>", recipient_list=[email], ) diff --git a/billing/templates/billing/emails/payment-receipt.txt b/billing/templates/billing/emails/payment-receipt.txt index f2477c0..0c3c86f 100644 --- a/billing/templates/billing/emails/payment-receipt.txt +++ b/billing/templates/billing/emails/payment-receipt.txt @@ -1,11 +1,11 @@ Hello {{ username }}! -This is a receipt for your latest Hostea payment. +This is a receipt for your latest Gna! payment. ----------------------------------------------------- -Hostea Receipt - {{payment.date.month}}/{{payment.date.day}}/{{payment.date.year}} +Gna! Receipt - {{payment.date.month}}/{{payment.date.day}}/{{payment.date.year}} - Instance Name: {{ payment.instance_name }} - Configuration: {{payment.instance_configuration_id.name}} @@ -19,4 +19,4 @@ To view the receipt online, please see the following link: We appreciate your business! Cheers, -Hostea team +Gna! team diff --git a/billing/views.py b/billing/views.py index 403e4dd..78e6164 100644 --- a/billing/views.py +++ b/billing/views.py @@ -128,9 +128,9 @@ def payment_success(request, payment_public_id): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Payment receipt your Hostea VM", + subject="[Gna!] Payment receipt your Hostea VM", message=body, - from_email=f"No reply Hostea<{sender}>", # TODO read from settings.py + from_email=f"No reply Gna!<{sender}>", # TODO read from settings.py recipient_list=[email], ) diff --git a/infrastructure/utils.py b/infrastructure/utils.py index 5729bc0..8e370d4 100644 --- a/infrastructure/utils.py +++ b/infrastructure/utils.py @@ -71,9 +71,9 @@ class Worker(Thread): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Your Hostea instance is now online!", + subject="[Gna!] Your Gna! instance is now online!", message=body, - from_email=f"No reply Hostea<{sender}>", # TODO read from settings.py + from_email=f"No reply Gna!<{sender}>", # TODO read from settings.py recipient_list=[email], ) job.delete() diff --git a/infrastructure/views.py b/infrastructure/views.py index 91c3695..066a081 100644 --- a/infrastructure/views.py +++ b/infrastructure/views.py @@ -69,9 +69,9 @@ def create_instance(request, instance_name: str): sender = settings.DEFAULT_FROM_EMAIL send_mail( - subject="[Hostea] Gitea admin credentials", + subject="[Gna!] Gitea admin credentials", message=body, - from_email=f"No reply Hostea<{sender}>", # TODO read from settings.py + from_email=f"No reply Gna!<{sender}>", # TODO read from settings.py recipient_list=[request.user.email], ) From ac0775e075996309e8864ccc0ebdad8e403e1212 Mon Sep 17 00:00:00 2001 From: Hostea dashboard Date: Mon, 12 Sep 2022 17:36:04 +0530 Subject: [PATCH 2/3] fix: rename to Gna! in email templates --- accounts/templates/accounts/emails/password-changed.txt | 4 ++-- .../templates/accounts/emails/password-reset-link.txt | 2 +- accounts/templates/accounts/emails/verification-link.txt | 2 +- billing/templates/billing/emails/payment-notification.txt | 4 ++-- .../templates/infrastructure/emails/gitea-creds.txt | 8 ++++---- .../templates/infrastructure/emails/instance-created.txt | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/accounts/templates/accounts/emails/password-changed.txt b/accounts/templates/accounts/emails/password-changed.txt index 8637abc..09a9686 100644 --- a/accounts/templates/accounts/emails/password-changed.txt +++ b/accounts/templates/accounts/emails/password-changed.txt @@ -2,7 +2,7 @@ Hello {{ username }}, You have a new password! -Your password for signing in to Hostea was recently changed. If you made this change, then we're all set. +Your password for signing in to Gna! was recently changed. If you made this change, then we're all set. If you did not make this change, please reset your password to secure your account. @@ -11,4 +11,4 @@ If you did not make this change, please reset your password to secure your accou Either way, feel free to reach out with any questions you might have. We're here to help. Cheers, -Hostea team +Gna! team diff --git a/accounts/templates/accounts/emails/password-reset-link.txt b/accounts/templates/accounts/emails/password-reset-link.txt index 3644af8..e8c5b5a 100644 --- a/accounts/templates/accounts/emails/password-reset-link.txt +++ b/accounts/templates/accounts/emails/password-reset-link.txt @@ -6,4 +6,4 @@ Please click on the link below to reset your password: If you don't recognise this activity, please delete this mail. Cheers, -Hostea team +Gna! team diff --git a/accounts/templates/accounts/emails/verification-link.txt b/accounts/templates/accounts/emails/verification-link.txt index f52a9a2..a9fbecd 100644 --- a/accounts/templates/accounts/emails/verification-link.txt +++ b/accounts/templates/accounts/emails/verification-link.txt @@ -6,4 +6,4 @@ Please click on the link below to verify your email. If you don't recognise this activity, please delete this mail. Cheers, -Hostea team +Gna! team diff --git a/billing/templates/billing/emails/payment-notification.txt b/billing/templates/billing/emails/payment-notification.txt index cd43a48..7435bc8 100644 --- a/billing/templates/billing/emails/payment-notification.txt +++ b/billing/templates/billing/emails/payment-notification.txt @@ -1,6 +1,6 @@ Hello {{ username }}! -An invoice is generated for your Hostea VM {{ payment.instance_name }}. +An invoice is generated for your Gna! VM {{ payment.instance_name }}. - Configuration: {{payment.instance_configuration_id.name}} - Invoice generated on: {{payment.date.month}}/{{payment.date.day}}/{{payment.date.year}} @@ -11,4 +11,4 @@ To pay, please click the link below: {{ link }} Cheers, -Hostea team +Gna! team diff --git a/infrastructure/templates/infrastructure/emails/gitea-creds.txt b/infrastructure/templates/infrastructure/emails/gitea-creds.txt index 532a429..b36e123 100644 --- a/infrastructure/templates/infrastructure/emails/gitea-creds.txt +++ b/infrastructure/templates/infrastructure/emails/gitea-creds.txt @@ -1,12 +1,12 @@ Hello {{ username }}, -Congratulations on your new Hostea instance! +Congratulations on your new Gna! instance! -Your Hostea instance is being prepared, you will receive an email +Your Gna! 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 Hostea Gitea instance. Great powers come with great +your new Gna! Gitea instance. Great powers come with great responsibilities, so use the admin credentials wisely. When in doubt, consult the Gitea docs or contact support! @@ -15,4 +15,4 @@ consult the Gitea docs or contact support! - Gitea {{ gitea_uri }} Cheers, -Hostea team +Gna! team diff --git a/infrastructure/templates/infrastructure/emails/instance-created.txt b/infrastructure/templates/infrastructure/emails/instance-created.txt index 15f4f7d..2de0d14 100644 --- a/infrastructure/templates/infrastructure/emails/instance-created.txt +++ b/infrastructure/templates/infrastructure/emails/instance-created.txt @@ -1,6 +1,6 @@ Hello {{ username }}!, -The deployment job has run to completion and your Hostea instance is now online! +The deployment job has run to completion and your Gna! instance is now online! Credentials to admin account was sent in an earlier email, please contact support if didn't receive it. @@ -8,4 +8,4 @@ Gitea: {{ gitea_uri }} Woodpecker CI: {{ woodpecker_uri }} Cheers, -Hostea team +Gna! team From 0e0b8db94068c4607b6eb0d413f7a4bd53950018 Mon Sep 17 00:00:00 2001 From: Hostea dashboard Date: Mon, 12 Sep 2022 17:36:24 +0530 Subject: [PATCH 3/3] fix: test for Gna! in emails --- billing/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/billing/tests.py b/billing/tests.py index b165506..14d3cda 100644 --- a/billing/tests.py +++ b/billing/tests.py @@ -98,11 +98,12 @@ class BillingTest(TestCase): # and then the Gitea instance credentials notification followed by the # invoice generation email. receipt_mail = mail.outbox.pop() + print(receipt_mail.body) self.assertEqual( all( [ receipt_mail.to[0] == self.email, - "This is a receipt for your latest Hostea payment" + "This is a receipt for your latest Gna! payment" in receipt_mail.body, ] ), @@ -114,7 +115,7 @@ class BillingTest(TestCase): all( [ instance_notificaiton.to[0] == self.email, - "Congratulations on your new Hostea instance!" + "Congratulations on your new Gna! instance!" in instance_notificaiton.body, ] ),