The CreatorCon Call for Content is officially open! Get started here.

email.addAddress of current user

asher14
Tera Contributor

I am writing a script include.

I am trying to add the Address of the user who created the request.  How do I add the sys_created_by or sys_id email of the person who created the request?

 

if(current.getValue('u_drop_off') == '1' {

    var dropOff = gs.getProperty('Location');

    email.addAddress(dropOff);

    email.addAddress(EMAIL OF THE USER WHO CREATED REQUEST);

}

1 ACCEPTED SOLUTION

If you want to send email to the requester, in the User/Group in fields, you can select the field which holds the user value.

SanjivMeher_0-1671744795848.png

If you want to send email with user in CC, you can use script 

if(current.getValue('u_drop_off') == '1' {

    var dropOff = gs.getProperty('Location');

    email.addAddress('cc',dropOff);

    email.addAddress('cc',current.requested_for.email);

}

 

Can you also confirm, your notification is on sc_request table?


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

18 REPLIES 18

I checked 'send to created' on the notification record.

 

The environment is customized but is on a service portal for sure.

I am see the dropOff property being cc'd. 

Now just not seeing the user also cc'd. 

asher14
Tera Contributor

Also when I preview the notification its showing me the user will be emailed. But when I check the emails in the backend im not seeing it user email in the 'copied' field

Hey, If my understanding is correct, you need the the user in 'cc' who created the request.

 

-You need to be sure about the usage of 'send to event creator' field.

-If 'send to event creator' field is not checked, it will exclude that particular user from the email recipients even you have included him users/group or parm1, parm2.

 

you can also cross check the script which you have written. Arguments must be passed with the right value in addAddress() method.

e.g. -

 

//if you are getting value from gliderecord or by dot wallking
email.addAddress("cc", gliderec.user.email.toString(), gliderec.user.getDisplayValue());

//if values are hard coded
email.addAddress("cc", 'email address','name of the user');

 

To understand it more I would like to get more information on script and notification which you have configured.

you can attach the snapshots.

 

Hope this helps!

Regards,

Kartik

Thank you!

Kartik Choudha1
Tera Guru

Hey,

If my understanding is correct, you need the the user in 'cc' who created the request.

 

-You need to be sure about the usage of 'send to event creator' field.

-If 'send to event creator' field is not checked, it will exclude that particular user from the email recipients even you have included him users/group or parm1, parm2.

 

you can also cross check the script which you have written. Arguments must be passed with the right value in addAddress() method.

e.g. -

//if you are getting value from gliderecord or by dot wallking
email.addAddress("cc", gliderec.user.email.toString(), gliderec.user.getDisplayValue());

//if values are hard coded
email.addAddress("cc", 'email address','name of the user');

To understand it more I would like to get more information on script and notification which you have configured.

you can attach the snapshots.

 

Hope this helps!

Regards,

Kartik