Issue with Reply-To Field Limiting Email Addresses in Email Script Templates

Saraswathi Devi
Tera Contributor

Hi Everyone,

 

I have a requirement where I need to set the "Reply-To" field in email script templates to include the email addresses of all members of a specific group. This group has 12 members. I have created a Script Include for this purpose and, based on the logs, I can confirm that all 12 members' email addresses are being retrieved correctly.

 

However, when I open the email on the form, the "Reply-To" field only displays 5 of these email addresses. Interestingly, when I manually enter the email addresses, it accepts all 12 without any issues.

Has anyone else experienced this limitation or have any insights on why this might be happening? Any suggestions or workarounds to ensure all 12 email addresses appear in the "Reply-To" field would be greatly appreciated.

4 REPLIES 4

Mark Manders
Mega Patron

Can you share the code? If it's in there, it would be good if we have it as well. Both the code from the script include as the code calling it would be helpful.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Saraswathi Devi
Tera Contributor

Hi @Mark Manders ,

 

Script include script:


var AgentAssignmentGrpMem1 = Class.create();
AgentAssignmentGrpMem1.prototype = {
initialize: function() {},

getReplyTo: function(table, record) {

var replyTo = '';
var ga = new GlideRecord(table);
if (ga.get(record)) {
// Check if 'assigned_to' is filled
if (ga.assigned_to) {
var assignedToUser = new GlideRecord('sys_user');
if (assignedToUser.get(ga.assigned_to)) {
replyTo = assignedToUser.email;
}
} else {
var groupMembers = [];
var groupMemberGR = new GlideRecord('sys_user_grmember');
groupMemberGR.addQuery('group', ga.assignment_group);
groupMemberGR.query();
while (groupMemberGR.next()) {

var member = new GlideRecord('sys_user');
if (member.get(groupMemberGR.user) && (member.active == true)) {
groupMembers.push(member.email);
}
}
replyTo = groupMembers.join('; ');
}
}
return replyTo;
},
type: 'AgentAssignmentGrpMem1'
};


Script that used in reply to field:

javascript:new global.AgentAssignmentGrpMem1().getReplyTo(current.getTableName(),current.sys_id)

 

Mark Manders
Mega Patron

Can you check on the data of the users that aren't included when you do it through the script include? Are they active? Are the email addresses filled? It could also be useful to check on the field size of 'reply-to'. OOB it's set to 100. Your script will be limited to that 100 (I guess), while typing ignores that.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Saraswathi Devi
Tera Contributor

@Mark Manders ,

 

Yes, the users which are truncated during the email are active and i can see their email id's when i put logs in the script include. Size of the reply to field is 1000. Is there any where limit is set to low other than max length?

SaraswathiDevi_0-1720616830553.png