1

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");

closed as off-topic by Sebastian Kessel, Mohith Shrivastava, Adrian Larson, Santanu Boral, Lance Shi Jan 22 '17 at 7:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions not specific to Salesforce are off-topic here, but can be asked on Stack Overflow." – Sebastian Kessel, Mohith Shrivastava, Adrian Larson, Santanu Boral, Lance Shi
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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