How to hide attachment icon from Compose Email

damirkreho
Tera Contributor

We've enabled our users from request item to click "Send Email" and give them option to compose and send an email to any email address.  With this functionality we would like hide the attachment icon (see image) from the compose email client and force the user to manage attachments from request item.  Any help on how to accomplish this would be very much appreciated.

 

damirkreho_0-1692628604950.png

 

2 REPLIES 2

Eswar Chappa
Mega Sage
Mega Sage

Hi @damirkreho Please find the below  community article for reference:

 

https://www.servicenow.com/community/itsm-forum/hide-attachment-on-record-producer-quot-report-vacci...

 

Cheers, hope that helps

Eswar Chappa

*** Please mark as "Correct" or "Helpful" as appropriate ***

Eswar Chappa
Mega Sage
Mega Sage

Hi @damirkreho created a client script with below code it was working Can you please check

 

EswarChappa_0-1692631261612.png

EswarChappa_1-1692631284079.png

function onLoad() {
	//Type appropriate comment here, and begin script below

	if(window == null){
		var z = this.document.getElementsByClassName("panel-button sp-attachment-add btn btn-link");
		z[0].style.display = 'none';

		var k = this.document.getElementsByClassName("file-upload-input");
		k[0].style.display = 'none';

		var aTags = this.document.getElementsByTagName("span");
		var searchText = "Add attachments";
		var found;

		for (var i = 0; i < aTags.length; i++) {
			if (aTags[i].textContent == searchText) {
				aTags[i].style.display = 'none';
				break;
			}
		}
	}
	else{
		document.getElementById("sc_attachment_button").hide();
	}

}

Cheers, hope that helps

Eswar Chappa

*** Please mark as "Correct" or "Helpful" as appropriate ***