fix-email-sender #33

Merged
dachary merged 5 commits from fix-email-sender into master 2022-07-04 16:42:03 +00:00

Tasks

  • move email body rendering from within app code to templates
  • adopt @Gusted suggestion to improve the email content
  • create EMAIL_SENDER_ADDRESS allow sender address configuration

Example endered email content

Email verification


[Hostea] Please confirm your email address
From:
No reply Hostea <no-reply@hostea.org>
To:
realaravinth@hostea.org
Hello realaravinth,

Please click on the link below to verify your email.
http://localhost:8000/accounts/verify/ZW5OjoXxkKoaJJu3aKusth1e4aab9uUk/

If you don't recognise this activity, please delete this mail.

Cheers,
Hostea team

Instance online notification

Hostea] Your Hostea instance is now online!
From:
No reply Hostea <no-reply@hostea.org>
To:
realaravinth@batsense.net
Hello atm!,

The deployment job has run to completion and your Hostea instance is now online!
Credentials to admin account was sent in an earlier email, please contact
support if didn't receive it.

Gitea: https://gitea.hostea.org
Woodpecker CI: https://gitea-ci.hostea.org

Cheers,
Hostea team

Gitea credentials email

 Text
Download

    Delete

[Hostea] Your Hostea instance is now online!
From:
No reply Hostea <no-reply@hostea.org>
To:
realaravinth@batsense.net
Hello atm,

Congratulations on your new Gitea instance!

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!

    - username : root
    - password: 3sDWuT2Wk35kY1fibULI
    - Gitea   https://test333333.hostea.org

Cheers,
Hostea team

fixes: https://gitea.hostea.org/Hostea/dashboard/issues/25
fixes: https://gitea.hostea.org/Hostea/dashboard/issues/16

## Tasks - move email body rendering from within app code to templates - adopt @Gusted suggestion to improve the email content - create `EMAIL_SENDER_ADDRESS` allow sender address configuration ## Example endered email content ### Email verification ``` [Hostea] Please confirm your email address From: No reply Hostea <no-reply@hostea.org> To: realaravinth@hostea.org Hello realaravinth, Please click on the link below to verify your email. http://localhost:8000/accounts/verify/ZW5OjoXxkKoaJJu3aKusth1e4aab9uUk/ If you don't recognise this activity, please delete this mail. Cheers, Hostea team ``` ### Instance online notification ``` Hostea] Your Hostea instance is now online! From: No reply Hostea <no-reply@hostea.org> To: realaravinth@batsense.net Hello atm!, The deployment job has run to completion and your Hostea instance is now online! Credentials to admin account was sent in an earlier email, please contact support if didn't receive it. Gitea: https://gitea.hostea.org Woodpecker CI: https://gitea-ci.hostea.org Cheers, Hostea team ``` ### Gitea credentials email ``` Text Download Delete [Hostea] Your Hostea instance is now online! From: No reply Hostea <no-reply@hostea.org> To: realaravinth@batsense.net Hello atm, Congratulations on your new Gitea instance! 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! - username : root - password: 3sDWuT2Wk35kY1fibULI - Gitea https://test333333.hostea.org Cheers, Hostea team ``` fixes: https://gitea.hostea.org/Hostea/dashboard/issues/25 fixes: https://gitea.hostea.org/Hostea/dashboard/issues/16
realaravinth added 4 commits 2022-07-04 09:34:09 +00:00
realaravinth requested review from Owners 2022-07-04 09:34:21 +00:00
realaravinth self-assigned this 2022-07-04 09:34:28 +00:00
dachary reviewed 2022-07-04 10:26:19 +00:00
@ -37,2 +47,4 @@
email = challenge.owned_by.email
sender = settings.HOSTEA["EMAIL_SENDER_ADDRESS"]

Enough already sets DEFAULT_FROM_EMAIL, see here.

Could this be used instead? That would save me the trouble of a new release :-)

Enough already sets [DEFAULT_FROM_EMAIL](https://docs.djangoproject.com/en/4.0/ref/settings/#std-setting-DEFAULT_FROM_EMAIL), see [here](https://lab.enough.community/main/infrastructure/-/blob/master/playbooks/hosteadashboard/roles/hosteadashboard/templates/local_settings.py.j2#L107). Could this be used instead? That would save me the trouble of a new release :-)

Sure, didn't notice that :)

Sure, didn't notice that :)
realaravinth added 1 commit 2022-07-04 10:37:51 +00:00
ci/woodpecker/push/woodpecker Pipeline failed Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
887c65d324
fix: s/EMAIL_SENDER_ADDRESS/DEFAULT_FROM_EMAIL/
dachary requested changes 2022-07-04 10:55:57 +00:00
@ -55,6 +55,7 @@ PAYMENT_VARIANTS = {
HOSTEA = {
"SOURCE_CODE": "https://gitea.hostea.org/Hostea/dashboard",
"INSTANCE_MAINTAINER_CONTACT": "contact@hostea.example.org",
"DEFAULT_FROM_EMAIL": "no-reply@hostea.org",

This should be at the top-level since it is a Django defined variable.

This should be at the top-level since it is a Django defined variable.
realaravinth force-pushed fix-email-sender from 887c65d324 to 59c1034b93 2022-07-04 12:57:40 +00:00 Compare
realaravinth requested review from dachary 2022-07-04 13:02:04 +00:00
dachary approved these changes 2022-07-04 16:41:49 +00:00
dachary merged commit 9303ea59ed into master 2022-07-04 16:42:03 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Hostea/dashboard#33
There is no content yet.