mail api – DijitalTurk https://dijitalturk.com/veysel Dijital Paylaşımlar Fri, 02 Feb 2024 10:43:51 +0000 tr hourly 1 EMAIL API kullanarak e-posta gönderme https://dijitalturk.com/veysel/email-api-kullanarak-e-posta-gonderme/ https://dijitalturk.com/veysel/email-api-kullanarak-e-posta-gonderme/#respond Fri, 02 Feb 2024 10:43:51 +0000 https://dijitalturk.com/veysel/?p=1963 Aşağıdaki kod ile servicenow standart email api’sini kullanarak eposta gönderebilirsiniz. var url = 'https://dev186271.service-now.com/api/now/v1/email'; var username = 'denemeUser'; var password

The post EMAIL API kullanarak e-posta gönderme appeared first on DijitalTurk.

]]>
Aşağıdaki kod ile servicenow standart email api’sini kullanarak eposta gönderebilirsiniz.

 var url = 'https://dev186271.service-now.com/api/now/v1/email';
 var username = 'denemeUser';
 var password = 'xxxxxxx';

 var data = {
   to: [
     'User1 <user1@example.com>',
     'User2 <user2@example.com>'
   ],
   cc: [
     'User3 <user3@example.com>',
     'User4 <user4@example.com>'
   ],
   bcc: [
     'User5 <user5@example.com>',
     'User6 <user6@example.com>'
   ],
   subject: 'Hello There',
   text: 'Test Message',
   html: '<b>Test Message</b>',
   table_name: 'incident',
   table_record_id: '061b4b6d938002104d1a3a4efaba1005',
   headers: {
     'X-Custom': 'header'
   }
 };

var request = new sn_ws.RESTMessageV2();
 request.setEndpoint(url);
 request.setRequestHeader('Accept', 'application/json');
 request.setRequestHeader('Content-Type', 'application/json');
 request.setRequestHeader('Authorization', 'Basic ' + GlideStringUtil.base64Encode(username + ':' + password));
 request.setHttpMethod('post');
 request.setRequestBody(JSON.stringify(data));
 var response = request.execute();

 var responseBody = response.getBody();
 var httpStatus = response.getStatusCode();
 gs.info('Response: ' + responseBody);
 gs.info('HTTP Status: ' + httpStatus);

 

 

The post EMAIL API kullanarak e-posta gönderme appeared first on DijitalTurk.

]]>
https://dijitalturk.com/veysel/email-api-kullanarak-e-posta-gonderme/feed/ 0