how to test email.to condition in dev instance

avanis
Kilo Contributor

i am trying to test an forward type inbound action having condition in the script:

createRequest();

function createRequest() {

if(email.to.toString().toLowerCase().indexOf("ssc-atp@test.com") > -1){

But i am not sure how to test this as i am forwarding mail to this user and not to instance.

i am not getting anything in the email logs as well.

Any guide how to test this scenario...

5 REPLIES 5

georgimavrodiev
Mega Guru

Hello Avani,





Usually, when I want to test if my DEV instance sends any emails /email notifications/ to a contact ID (email address), I always look into the email logs.
Yet, before doing so I ensure that the Email Sending option is enabled (System Properties > Email Properties). Is it enabled in your platform?
If it is and yet no emails are being send to the email address you specified, then why don't you add an info line in your code to see if it will be displayed in the System Logs?




Best Regards,
Georgi Mavrodiev



IT Consultant
Do IT Wise



You may visit us in our Web Site: www.doitwise.com


from where we can send mail from dev instance ??


all the properties are enabled...


nasrin786
Kilo Expert

Hi Avani,


  By using inbound email we can forward email:


keep a condition like this :   email.body.indexOf('Ref:MSG') > -1 )


    system policy-->email--> inbound actions



comm00000001.png



Script:



current.caller_id = gs.getUserID();


current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;


current.short_description = email.subject;



current.category = "request";


current.incident_state = IncidentState.NEW;


current.notify = 2;


current.contact_type = "email";



if (email.body.assign != undefined)


    current.assigned_to = email.body.assign;



if (email.body.priority != undefined)


    current.priority = email.body.priority;



current.insert();



please follow this link:


http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#gsc.tab=0



find_real_file.png



PS: Your feedback (Like, Helpful or Correct) helps community


nasrin786
Kilo Expert

Hi Avani,



we can send mails through Notifications from developer instance..



system notifications-->email--> notifications


notify001.png



notify 111111122222222.png


please go through these links:


http://wiki.servicenow.com/index.php?title=Configuring_Email#gsc.tab=0


http://wiki.servicenow.com/index.php?title=Email_Notifications#gsc.tab=0




please hit like/comment or helpful if applicable