From 234defc723c7aa72dba4ad08f0c6204d1a80a364 Mon Sep 17 00:00:00 2001 From: Rahul Date: Mon, 22 Jul 2019 14:30:06 +0530 Subject: [PATCH] add mailing option in form --- app/views/admin/emails/custom_email.html.haml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/admin/emails/custom_email.html.haml b/app/views/admin/emails/custom_email.html.haml index ac23c91c..f9894097 100644 --- a/app/views/admin/emails/custom_email.html.haml +++ b/app/views/admin/emails/custom_email.html.haml @@ -10,7 +10,7 @@ = text_field_tag :to, '', class: 'form-control', id: 'admin_email_to', data: { keys: @keys } %br %p.text-right - = link_to 'Send Email', '', class: 'btn btn-primary' + = link_to 'Send Email', '', class: 'btn btn-primary', id: 'send_mail' :javascript $(document).ready(function() { @@ -38,6 +38,9 @@ } selectizeControl.on('change', function() { var emails_in_to_field = selectizeControl.getValue(); + var emails_array = emails_in_to_field.split(","); + var text = "mailto:".concat(emails_array.shift(), "?bcc=", emails_array.join()); + document.getElementById("send_mail").href = text; if (emails_in_to_field==''){ selectizeControl.clearOptions(); for(var key in email_hash){