Open Outlook email from Service catalog form

Anjy Choudhary
Tera Contributor

Hi All,

I have a requirement wherein when user is submitting a Service Request, there is a variable named as 'Training Required' if user selects 'Yes' on SR form, it should open email window in outlook and will copy some details from SR form to outlook email and email address in 'To' will be auto-populated with training team's DL.

Has anybody implemented this kind of requirement or any alternate to implement the same.

Thanks, 

Anjali

1 ACCEPTED SOLUTION

Vasantharajan N
Giga Sage
Giga Sage

Please try the below code, It opens the user's default email client and populates the default values 

Make sure "Isolate script" is set to false in the Catalog Client script

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	if(newValue == 'Yes'){
		var msg = g_form.getValue('q2'); // Please set the right variable name that goes into the email body		
		window.location.href = "mailto:user@example.com?subject=Subject&body="+msg;
	}   
}

Result:

find_real_file.png


Thanks & Regards,
Vasanth

View solution in original post

4 REPLIES 4

Vasantharajan N
Giga Sage
Giga Sage

Please try the below code, It opens the user's default email client and populates the default values 

Make sure "Isolate script" is set to false in the Catalog Client script

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	if(newValue == 'Yes'){
		var msg = g_form.getValue('q2'); // Please set the right variable name that goes into the email body		
		window.location.href = "mailto:user@example.com?subject=Subject&body="+msg;
	}   
}

Result:

find_real_file.png


Thanks & Regards,
Vasanth

Thanks a ton!!

It helped..

Glad that it helped you. Please mark my answer correct and helpful if that solves your query which helps the other people having similar question.


Thanks & Regards,
Vasanth

Anjy Choudhary
Tera Contributor

Hi Vasantharajan,

Can we also auto-populate email body with some predefined template, we do not need any thing from SR but display some predefined data in email body.

Thanks

Anjali