This repository was archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Use realm email to send mail templates #849
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
78b1cfc
starting email template
whaught 6cf444d
first thing
whaught 3613515
email settings
whaught d2ec5ab
Merge remote-tracking branch 'upstream/main' into realm-email-setting
whaught 3a1dd10
fixes form integrate
whaught eca29c8
update migrations
whaught 1563e26
some feedback
whaught b953abf
words
whaught 5bb6a21
remaining migration
whaught 1476644
fix form fields
whaught 48df05a
default port
whaught 257a98f
provider type
whaught 996fe11
actually save settings
whaught 0d353be
tested
whaught 32101e5
Merge remote-tracking branch 'upstream/main' into use-realm-email
whaught 7457237
use realm emailer to send mail
whaught 57011e8
fix error
whaught 80a1276
sned invite
whaught 48300a7
handle verification email
whaught a5a0274
reset password from system
whaught 4ca5a9a
lint
whaught 3c1576d
review stuff
whaught b80e341
nils
whaught 8f5e42a
review stuff
whaught dc80624
merge send realm email code
whaught 78f7f95
expect notfound
whaught 510812a
unit test
whaught e0cbda5
json ignore
whaught 351b0a1
ignore on sms
whaught 9464021
only fallback on error
whaught 1cab802
fix notfound error message
whaught 0c2a1e3
Merge remote-tracking branch 'upstream/main' into use-realm-email
whaught 532e9e0
correct import
whaught cc7d8dd
ensure new port 587
whaught File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,11 @@ | ||
{{- define "email/verifyemail" -}} | ||
{{template "email/plainheader" .}} | ||
|
||
Hello, | ||
|
||
Click the link below to verify your email address for {{.RealmName}} on the COVID-19 exposure notifications verification server: | ||
|
||
{{.VerifyLink}} | ||
|
||
If you did not request verification of this email, please disregard this message. | ||
{{end}} |
This file contains hidden or 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,11 @@ | ||
{{- define "email/passwordresetemail" -}} | ||
{{template "email/plainheader" .}} | ||
|
||
Hello, | ||
|
||
Click the link below to reset your password for the COVID-19 exposure notifications verification server. | ||
|
||
{{.ResetLink}} | ||
|
||
If you did not request a password reset, please disregard this message. | ||
{{end}} |
This file contains hidden or 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
This file contains hidden or 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,89 @@ | ||
{{define "realmadmin/_form_email"}} | ||
|
||
{{$realm := .realm}} | ||
{{$emailConfig := .emailConfig}} | ||
|
||
<p class="mb-4"> | ||
These are the settings for configuring an SMTP email provider. The verification server | ||
will use this email account to send invitations, password resets, and account-verifications | ||
for the realm. | ||
</p> | ||
|
||
<form method="POST" action="/realm/settings#email" class="floating-form"> | ||
{{ .csrfField }} | ||
<input type="hidden" name="email" value="1" /> | ||
|
||
{{if $realm.CanUseSystemEmailConfig}} | ||
{{if $realm.UseSystemEmailConfig}} | ||
<div class="alert alert-danger"> | ||
<strong>Warning!</strong> You are currently using the system-provided | ||
SMTP email configuration. Specifying values below will override the system | ||
configuration to use your supplied credentials. | ||
</div> | ||
{{end}} | ||
|
||
<div class="form-group form-check"> | ||
<input type="checkbox" name="use_system_smtp_config" id="use-system-smtp-config" class="form-check-input" value="1" {{if $realm.UseSystemEmailConfig}} checked{{end}} | ||
data-toggle="collapse" data-target="#smtp-form"> | ||
<label class="form-check-label" for="use-system-smtp-config"> | ||
Use system SMTP configuration | ||
</label> | ||
</div> | ||
{{end}} | ||
|
||
<div id="smtp-form" class="collapse{{if not $realm.UseSystemEmailConfig}} show{{end}}"> | ||
<div class="form-label-group"> | ||
<input type="text" name="smtp_account" id="smtp-account" class="form-control text-monospace{{if $emailConfig.ErrorsFor "smtpAccount"}} is-invalid{{end}}" | ||
placeholder="SMTP account" value="{{if $emailConfig}}{{$emailConfig.SMTPAccount}}{{end}}" /> | ||
<label for="smtp-account">SMTP account</label> | ||
{{template "errorable" $emailConfig.ErrorsFor "smtpAccount"}} | ||
<small class="form-text text-muted"> | ||
This is the SMTP email account eg. noreply@example.com | ||
</small> | ||
</div> | ||
|
||
<div class="form-label-group"> | ||
<div class="input-group"> | ||
<input type="password" name="smtp_password" id="smtp-password" class="form-control text-monospace{{if $emailConfig.ErrorsFor "smtpPassword"}} is-invalid{{end}}" autocomplete="new-password" | ||
placeholder="SMTP password" value="{{if $emailConfig}}{{$emailConfig.SMTPPassword}}{{end}}"> | ||
<label for="smtp-password">SMTP password</label> | ||
<div class="input-group-append"> | ||
<a class="input-group-text" data-toggle-password="smtp-password"> | ||
<span class="oi oi-lock-locked" aria-hidden="true"></span> | ||
</a> | ||
</div> | ||
</div> | ||
{{template "errorable" $emailConfig.ErrorsFor "smtpPassword"}} | ||
<small class="form-text text-muted"> | ||
This is the password for your SMTP email. | ||
</small> | ||
</div> | ||
|
||
<div class="form-label-group"> | ||
<input name="smtp_host" id="smtp-host" class="form-control text-monospace{{if $emailConfig.ErrorsFor "smtpPort"}} is-invalid{{end}}" | ||
placeholder="SMTP host" value="{{if $emailConfig}}{{$emailConfig.SMTPHost}}{{end}}" /> | ||
<label for="smtp-port">SMTP host</label> | ||
{{template "errorable" $emailConfig.ErrorsFor "smtpHost"}} | ||
<small class="form-text text-muted"> | ||
SMTP host is the hostname for the SMTP server. | ||
</small> | ||
</div> | ||
|
||
<div class="form-label-group"> | ||
<input name="smtp_port" id="smtp-port" class="form-control text-monospace{{if $emailConfig.ErrorsFor "smtpPort"}} is-invalid{{end}}" | ||
placeholder="SMTP port" value="{{if $emailConfig}}{{$emailConfig.SMTPPort}}{{else}}587{{end}}" /> | ||
<label for="smtp-port">SMTP port</label> | ||
{{template "errorable" $emailConfig.ErrorsFor "smtpPort"}} | ||
<small class="form-text text-muted"> | ||
SMTP port is the port number to connect to. | ||
587 is the default port for SMTP, and legacy port 25 is blocked. | ||
</small> | ||
</div> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<input type="submit" class="btn btn-primary btn-block" value="Update SMTP settings" /> | ||
</div> | ||
</form> | ||
|
||
{{end}} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.