From: Guillaume AGNIERAY Date: Mon, 25 Sep 2023 15:41:12 +0000 (+0200) Subject: Fix email testing; closes #1699 X-Git-Tag: 1.0.0rc2~94 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=e530a3347b3f0dbd18325aefb2591838cbb4e074;p=galette.git Fix email testing; closes #1699 --- diff --git a/galette/templates/default/pages/preferences.html.twig b/galette/templates/default/pages/preferences.html.twig index 8f82aa4fe..5080c3fc7 100644 --- a/galette/templates/default/pages/preferences.html.twig +++ b/galette/templates/default/pages/preferences.html.twig @@ -910,43 +910,43 @@ title: '{{ _T("Enter the email adress")|e('js') }}', class: 'tiny', content: _input, + onApprove: function() { + $.ajax({ + url: _this.attr('href'), + type: 'GET', + data: { + adress: $('#email_adress').val() + }, + {% include "elements/js/loader.js.twig" with { + selector: '#btnmail', + loader: 'button' + } %}, + success: function(res) { + //display message + $.ajax({ + url: '{{ url_for('ajaxMessages') }}', + method: "GET", + success: function (message) { + $('#testEmail').prepend(message); + } + }); + }, + error: function () { + {% include "elements/js/modal.js.twig" with { + modal_title_twig: _T("An error occurred sending test email :(")|e("js"), + modal_without_content: true, + modal_class: "mini", + modal_deny_only: true, + modal_cancel_text: _T("Close")|e("js"), + modal_classname: "redalert", + } %} + } + }); + }, actions: [{ text : '{{ _T("Send")|e('js') }}', icon : 'rocket', - class : 'icon labeled green approve', - click : function() { - $.ajax({ - url: _this.attr('href'), - type: 'GET', - data: { - adress: $('#email_adress').val() - }, - {% include "elements/js/loader.js.twig" with { - selector: '#btnmail', - loader: 'button' - } %}, - success: function(res) { - //display message - $.ajax({ - url: '{{ url_for('ajaxMessages') }}', - method: "GET", - success: function (message) { - $('#testEmail').prepend(message); - } - }); - }, - error: function () { - {% include "elements/js/modal.js.twig" with { - modal_title_twig: _T("An error occurred sending test email :(")|e("js"), - modal_without_content: true, - modal_class: "mini", - modal_deny_only: true, - modal_cancel_text: _T("Close")|e("js"), - modal_classname: "redalert", - } %} - } - }); - } + class : 'icon labeled green approve' }, { text : '{{ _T("Cancel")|e('js') }}', icon : 'times',