fix: check site conf before sending email
This commit is contained in:
@@ -3,12 +3,21 @@
|
|||||||
{{ __('Components') }}
|
{{ __('Components') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-5">
|
<div class="mt-5">
|
||||||
|
<Tooltip
|
||||||
|
:text="
|
||||||
|
__(
|
||||||
|
'Content such as quiz, video and image will be added in the editor you select.'
|
||||||
|
)
|
||||||
|
"
|
||||||
|
placement="bottom"
|
||||||
|
>
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="text-xs text-gray-600 mb-1">
|
<div class="text-xs text-gray-600 mb-1">
|
||||||
{{ __('Select an Editor') }}
|
{{ __('Select an Editor') }}
|
||||||
</div>
|
</div>
|
||||||
<Select v-model="currentEditor" :options="getEditorOptions()" />
|
<Select v-model="currentEditor" :options="getEditorOptions()" />
|
||||||
</div>
|
</div>
|
||||||
|
</Tooltip>
|
||||||
<div class="flex mt-4">
|
<div class="flex mt-4">
|
||||||
<Link
|
<Link
|
||||||
v-model="quiz"
|
v-model="quiz"
|
||||||
@@ -63,7 +72,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import Link from '@/components/Controls/Link.vue'
|
import Link from '@/components/Controls/Link.vue'
|
||||||
import { FileUploader, Button, Select } from 'frappe-ui'
|
import { FileUploader, Button, Select, Tooltip } from 'frappe-ui'
|
||||||
import { Plus, FileText } from 'lucide-vue-next'
|
import { Plus, FileText } from 'lucide-vue-next'
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class LMSJobApplication(Document):
|
|||||||
outgoing_email_account = frappe.get_cached_value(
|
outgoing_email_account = frappe.get_cached_value(
|
||||||
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
||||||
)
|
)
|
||||||
if outgoing_email_account:
|
if outgoing_email_account or frappe.conf.get("mail_login"):
|
||||||
self.send_email_to_employer()
|
self.send_email_to_employer()
|
||||||
|
|
||||||
def validate_duplicate(self):
|
def validate_duplicate(self):
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class LMSAssignmentSubmission(Document):
|
|||||||
outgoing_email_account = frappe.get_cached_value(
|
outgoing_email_account = frappe.get_cached_value(
|
||||||
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
||||||
)
|
)
|
||||||
if outgoing_email_account:
|
if outgoing_email_account or frappe.conf.get("mail_login"):
|
||||||
self.send_mail()
|
self.send_mail()
|
||||||
|
|
||||||
def validate_duplicates(self):
|
def validate_duplicates(self):
|
||||||
|
|||||||
@@ -73,7 +73,9 @@ class LMSBatch(Document):
|
|||||||
outgoing_email_account = frappe.get_cached_value(
|
outgoing_email_account = frappe.get_cached_value(
|
||||||
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
||||||
)
|
)
|
||||||
if not student.confirmation_email_sent and outgoing_email_account:
|
if not student.confirmation_email_sent and (
|
||||||
|
outgoing_email_account or frappe.conf.get("mail_login")
|
||||||
|
):
|
||||||
self.send_mail(student)
|
self.send_mail(student)
|
||||||
student.confirmation_email_sent = 1
|
student.confirmation_email_sent = 1
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class LMSCertificate(Document):
|
|||||||
outgoing_email_account = frappe.get_cached_value(
|
outgoing_email_account = frappe.get_cached_value(
|
||||||
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
||||||
)
|
)
|
||||||
if outgoing_email_account:
|
if outgoing_email_account or frappe.conf.get("mail_login"):
|
||||||
self.send_mail()
|
self.send_mail()
|
||||||
|
|
||||||
def send_mail(self):
|
def send_mail(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user