From d146514c399a630cf91f72869f09dbd5ac0a5f39 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 20 Sep 2020 17:41:04 -0500 Subject: [PATCH] Prompt user if they try to send email preview w/ no address --- tailbone/templates/settings/email/view.mako | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tailbone/templates/settings/email/view.mako b/tailbone/templates/settings/email/view.mako index e7568398..be4f5774 100644 --- a/tailbone/templates/settings/email/view.mako +++ b/tailbone/templates/settings/email/view.mako @@ -92,7 +92,7 @@
- +
@@ -119,10 +119,16 @@ return { previewFormButtonText: "Send Preview Email", previewFormSubmitting: false, + userEmailAddress: ${json.dumps(request.user.email_address)|n}, } }, methods: { - submitPreviewForm() { + submitPreviewForm(event) { + if (!this.userEmailAddress) { + alert("Please provide an email address.") + event.preventDefault() + return + } this.previewFormSubmitting = true this.previewFormButtonText = "Working, please wait..." }