Created
August 21, 2014 00:04
-
-
Save DeskWOW/eddd9112b999873a6675 to your computer and use it in GitHub Desktop.
A custom case theme that evaluates to, cc, and bcc addresses in agent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="agent_ticket_section"> | |
{{csat}} | |
</div> | |
<div class="agent_ticket_section"> | |
{{subject}} | |
</div> | |
<div class="agent_ticket_section"> | |
<div> | |
{{status}} | |
</div> | |
<div> | |
{{priority}} | |
</div> | |
</div> | |
<div class="agent_ticket_section"> | |
<div> | |
{{group}} | |
</div> | |
<div> | |
{{user}} | |
</div> | |
</div> | |
<div class="agent_ticket_section"> | |
{{description}} | |
</div> | |
<div class="agent_ticket_section"> | |
{{language}} | |
</div> | |
<div class="agent_ticket_section"> | |
{{tags}} | |
</div> | |
{{widget.jira.body}} | |
<div id="case-id-{{case.id}}"></div> | |
<script> | |
function validateEmail($email) { | |
var emailReg = /(.+)@(.+){2,}\.(.+){2,}/; | |
if( !emailReg.test( $email ) ) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
setTimeout(function() { | |
console.log('test'); | |
console.log($("#case-id-{{case.id}}").parents(".active_ticket_type")); | |
$("#case-id-{{case.id}}").parents(".active_ticket_type").find(".email-input").keyup(function() { | |
$(this).parents(".a-text").removeClass("ct-warning"); | |
if ($(this).val().length < 1) { return false; } | |
bad_emails = 0; | |
emails = $(this).val(); | |
emails_array = emails.split(","); | |
emails_array.forEach(function(entry) { | |
if (!validateEmail(entry)) { | |
bad_emails++; | |
} | |
}); | |
if (bad_emails > 0) { | |
$(this).parents(".a-text").addClass("ct-warning"); | |
} | |
}); | |
}, 500); | |
</script> | |
<style> | |
body .a-text.ct-warning { | |
background: rgb(255, 221, 221); | |
border: 1px solid rgb(150, 0, 0); | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment