Email log Copied field is empty always why ?

Supriya25
Tera Guru

Hi Team,


"glide.email.test.user" property is EMPTY

Supriya25_0-1717117279033.png

 

 

Supriya25_1-1717117279031.png

 

 

then why mails not going to CC's and in sys_email logs list 'Copied ' field always empty .How to fix it ?

9 REPLIES 9

Kieran Anson
Kilo Patron

From your screenshot, you're passing in a GlideObject, rather than a string. Try passing in:

var recruiterEl = current.getElement('u_recruiter');
    if (gs.nil(recruiterEl))
        return;
    var recruiterGR = recruiterEl.getRefRecord();
    if (!recruiterGR.isValidRecord())
        return;
    email.addAddress('cc', recruiterGR.getValue('email'), recruiterGR.getDisplayValue())

Thanks for reply

kindly help me to understand but when I put gs.info  in my code I can see mail-id and name  in system logs  gs.info("Recruiter details : "+ current.u_recruiter.email+" " + current.u_recruiter.getDisplayValue()); but Not in Copied field.

In some areas of the platform, dot-walking to a value such as current.u_recruiter.email will coerce the value to the string value you're wanting. But it's not consistent and can lead to bugs. This is why it's best to use getValue, getDisplayValue and other 'getters' to get the string value you're actually expecting

I totally agree.
but  when we give dynamic value like below irrespective of code that value should come in CC field right ? but in my side value not coming "Copied" field....

email script : cc_details

 

 

email.addAddress("cc", "test@gmail.com", "test");

 

 

Notification: test

when to run : Record updated

who will received : users: my name

what it will contains : HTML body:  Updated record ${number}

${mail_script:cc_details}

Thanks

 

 

Email Logs Output:
Originating event and notification

event : notificaiton_engine.process

notification: test

 

Recipients: my name populating successfully 

Copied : empty , no value populated