Prompt user if they try to send email preview w/ no address

This commit is contained in:
Lance Edgar 2020-09-20 17:41:04 -05:00
parent 149ae4b71c
commit d146514c39

View file

@ -92,7 +92,7 @@
</div>
<div class="control">
<input name="recipient" type="email" class="input" value="${request.user.email_address or ''}" />
<b-input name="recipient" v-model="userEmailAddress"></b-input>
</div>
<div class="control">
@ -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..."
}