I have implemented a custom Javascript button called "Send Email" under Activity history. When a user clicks this button a new popup window should open that enables the user to send an e-mail. The JS code also displays the default from address, to address and template for the user. The new requirement is that after the user clicks the "Send" button, the popup window should auto-close. Find the code used to open the pop-up window below.

Could someone please suggest on how to auto-close this pop-up window?

[window.open("/_ui/core/email/author/EmailAuthor?p3_lkid={!Case.Id}&p2_lkid={!Case.ContactId}&p26=xxx@xxx.com&template_id=xxxxxxxxxxxxxx&retURL=%{!Case.Id}","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, width=800, height=650");
  • Is the send button a custom button or standard button? If custom, research window.close. Also, please go back to your original question about the URL in this question. Mark an answer accepted or add your own. Not only does it help others find answers but it is also nice when someone puts work into an answer to help you to have it accepted (if it was the correct answer) – Eric Jan 22 '17 at 5:50