[UPDT] BASE: Send mail preview function updated

This commit is contained in:
Horilla
2025-02-26 16:59:24 +05:30
parent 842f83110f
commit f464e2856b
7 changed files with 53 additions and 24 deletions

View File

@@ -176,13 +176,13 @@
});
});
function previewMail(){
var id = $('#template').val();
var body = $('#ack-form-{{cand.id}} [name="body"]').val()
if (id.length) {
if (body && body.trim() !== '') {
$.ajax({
type: "get",
url: `/recruitment/get-mail-preview/${id}/`,
url: `/recruitment/get-mail-preview/`,
data: { "candidate_id": "{{cand.id}}", "body":body },
dataType: "Json",
success: function (response) {

View File

@@ -471,7 +471,7 @@ urlpatterns = [
name="skill-zone-cand-delete",
),
path("get-template/<int:obj_id>/", get_template, name="get-template"),
path("get-mail-preview/<int:obj_id>/", get_mail_preview, name="get-mail-preview"),
path("get-mail-preview/", get_mail_preview, name="get-mail-preview"),
path("get-template-hint/", get_template_hint, name="get-template-hint"),
path(
"create-candidate-rating/<int:cand_id>/",

View File

@@ -443,7 +443,7 @@ def get_template_hint(request, obj_id=None):
@login_required
def get_mail_preview(request, obj_id=None):
def get_mail_preview(request):
"""
This method is used to return the mail template
"""