`;
+ }
+ });
+ list_html += "";
+
+ if (list_cc_not_exist_in_my_contact) {
+ return list_html;
+ }
+ }
+ return "";
+};
+
$(function () {
if (!hm_is_logged()) {
return;
@@ -467,6 +490,7 @@ $(function () {
let modalContentHeadline = '';
let dontWanValueInStorage = '';
+ let showBtnSendAnywayDontWarnFuture = true;
// If the subject is empty, we should warn the user
if (!subject) {
@@ -486,6 +510,17 @@ $(function () {
modalContentHeadline = "Your subject and body are empty!";
}
+ // if contact_cc not exist in contact list for user
+ var checkInList = "";
+ if (list_emails) {
+ checkInList = check_cc_exist_in_contacts_list(e);
+ if (checkInList) {
+ modalContentHeadline = "Adress mail not exist in your contact liste";
+ showBtnSendAnywayDontWarnFuture = false;
+ }
+ }
+
+
// If the user has disabled the warning, we should send the message
if (Boolean(Hm_Utils.get_from_local_storage(dontWanValueInStorage))) {
handleSendAnyway();
@@ -508,9 +543,11 @@ $(function () {
function showModal() {
if (! modal.modalContent.html()) {
modal.addFooterBtn(hm_trans('Send anyway'), 'btn-warning', handleSendAnyway);
- modal.addFooterBtn(hm_trans("Send anyway and don't warn in the future"), 'btn-warning', handleSendAnywayAndDontWarnMe);
+ if (showBtnSendAnywayDontWarnFuture) {
+ modal.addFooterBtn(hm_trans("Send anyway and don't warn in the future"), 'btn-warning', handleSendAnywayAndDontWarnMe);
+ }
}
- modal.setContent(modalContentHeadline + `
${hm_trans('Are you sure you want to send this message?')}