Skip to content

Commit

Permalink
fix: disable the mail sending test when no SMTP server is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Nov 13, 2024
1 parent 8f3ea59 commit 08e0dd4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 30 deletions.
36 changes: 24 additions & 12 deletions canaille/core/templates/mails/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,33 @@ <h2 class="ui center aligned header">
</div>
</h2>

<div class="ui info message">
{% trans %}
This form will send a dummy email to the address you want.
This should be used for testing mail configuration.
{% endtrans %}
</div>
{% if features.has_smtp %}

<div class="ui info message">
{% trans %}
This form will send a dummy email to the address you want.
This should be used for testing mail configuration.
{% endtrans %}
</div>

{% call fui.render_form(form) %}
{{ fui.render_field(form.email) }}
<div class="ui right aligned container">
<div class="ui stackable buttons">
<input type="submit" class="ui primary button" value="{{ _("Send") }}">
{% call fui.render_form(form) %}
{{ fui.render_field(form.email) }}
<div class="ui right aligned container">
<div class="ui stackable buttons">
<input type="submit" class="ui primary button" value="{{ _("Send") }}">
</div>
</div>
{% endcall %}

{% else %}

<div class="ui warning message">
{% trans %}
No mail server has been configured. The mail sending test is disabled.
{% endtrans %}
</div>
{% endcall %}

{% endif %}
</div>

<div class="ui segment">
Expand Down
40 changes: 22 additions & 18 deletions canaille/translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-10-28 11:57+0100\n"
"POT-Creation-Date: 2024-11-13 10:57+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -17,35 +17,35 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"

#: canaille/app/flask.py:100
#: canaille/app/flask.py:53
msgid "No SMTP server has been configured"
msgstr ""

#: canaille/app/forms.py:27
#: canaille/app/forms.py:26
msgid "This is not a valid URL"
msgstr ""

#: canaille/app/forms.py:34 canaille/app/forms.py:35
#: canaille/app/forms.py:33 canaille/app/forms.py:34
msgid "This value is a duplicate"
msgstr ""

#: canaille/app/forms.py:47
#: canaille/app/forms.py:46
msgid "Not a valid phone number"
msgstr ""

#: canaille/app/forms.py:55
#: canaille/app/forms.py:54
msgid "Field must be at least {minimum_password_length} characters long."
msgstr ""

#: canaille/app/forms.py:67
#: canaille/app/forms.py:66
msgid "Field cannot be longer than {maximum_password_length} characters."
msgstr ""

#: canaille/app/forms.py:240
#: canaille/app/forms.py:244
msgid "The page number is not valid"
msgstr ""

#: canaille/app/forms.py:268
#: canaille/app/forms.py:272
msgid "Not a valid datetime value."
msgstr ""

Expand Down Expand Up @@ -666,7 +666,7 @@ msgid "Send again"
msgstr ""

#: canaille/core/templates/forgotten-password.html:48
#: canaille/core/templates/mails/admin.html:52
#: canaille/core/templates/mails/admin.html:54
msgid "Send"
msgstr ""

Expand Down Expand Up @@ -987,7 +987,7 @@ msgstr ""
msgid "The user will not be able to authenticate unless the password is set"
msgstr ""

#: canaille/core/templates/mails/admin.html:97
#: canaille/core/templates/mails/admin.html:109
#: canaille/core/templates/mails/reset.html:19
#: canaille/core/templates/profile_settings.html:116
#: canaille/core/templates/reset-password.html:12
Expand Down Expand Up @@ -1102,38 +1102,42 @@ msgstr ""
msgid "Mail sending test"
msgstr ""

#: canaille/core/templates/mails/admin.html:42
#: canaille/core/templates/mails/admin.html:44
msgid ""
"This form will send a dummy email to the address you want. This should be"
" used for testing mail configuration."
msgstr ""

#: canaille/core/templates/mails/admin.html:61
msgid "Email preview"
#: canaille/core/templates/mails/admin.html:62
msgid "No mail server has been configured. The mail sending test is disabled."
msgstr ""

#: canaille/core/templates/mails/admin.html:73
msgid "Email preview"
msgstr ""

#: canaille/core/templates/mails/admin.html:85
#: canaille/core/templates/mails/test.html:19
#: canaille/core/templates/mails/test.txt:1
msgid "Connectivity test"
msgstr ""

#: canaille/core/templates/mails/admin.html:85
#: canaille/core/templates/mails/admin.html:97
#: canaille/core/templates/mails/firstlogin.html:19
#: canaille/core/templates/mails/reset.txt:1
msgid "Password initialization"
msgstr ""

#: canaille/core/templates/mails/admin.html:109
#: canaille/core/templates/mails/admin.html:121
#: canaille/core/templates/mails/email-confirmation.txt:1
msgid "Email verification"
msgstr ""

#: canaille/core/templates/mails/admin.html:121
#: canaille/core/templates/mails/admin.html:133
msgid "Invitation"
msgstr ""

#: canaille/core/templates/mails/admin.html:133
#: canaille/core/templates/mails/admin.html:145
#: canaille/core/templates/mails/registration.html:19
#: canaille/core/templates/mails/registration.txt:1
msgid "Registration"
Expand Down

0 comments on commit 08e0dd4

Please sign in to comment.