Question

Avoid sending mail to certain domain

Is there any setting to avoid sending mails to persons outside the company (for example @yahoo.com) on the test environments? We want to avoid sending the test mails to wrong persons or to wrong email addresses.

Like 1

Like

1 comments

You need to create a replacing view module for EmailMessagePublisherPage and EmailPageV2 and add the following replacement of the checkSenderBeforeSend method in both schemas methods:

checkSenderBeforeSend: function() {
				var recipient = this.get("Recepient");
				var copyRecipient = this.get("CopyRecepient");
				var blindCopyRecipient = this.get("BlindCopyRecepient");
				var allRecipientsList = recipient + copyRecipient + blindCopyRecipient;
				var isYahooMailboxPresent = allRecipientsList.indexOf("yahoo.com") != -1;
				if (isYahooMailboxPresent) {
					this.showInformationDialog(this.get("Resources.Strings.YahooMailboxIsInTheRecipients"));
					return;
				}
				this.callParent(arguments);
			},

Additionally you need to create a localizable string in both replaced modules with the YahooMailboxIsInTheRecipients code and the value you need (this will be a popup notification that there is the yahoo.com domain mailbox in the list of email recipients). As a result such email won't be sent (page refresh is required once these changes are applied) and end users will see the popup. 

Show all comments