Page 1 of 1

‘<>’ are just cut in Email notification

Posted: Mon Dec 19, 2016 1:27 am
by apugazhenthy
Dear Pavel,

Would require your expertise to address the below issue.

When we add any comments in between "<>" this symbols in Clear Quest get nullified in Email notification.

in the below screenshots I have added "<LIST.txt>" in the comment statement.

CQ1.jpg
CQ1.jpg (41.51 KiB) Viewed 2395 times


Then "<LIST.txt>" text was missing in the Email notification mail.

CQ2.jpg
CQ2.jpg (28.97 KiB) Viewed 2395 times

Re: ‘<>’ are just cut in Email notification

Posted: Mon Dec 19, 2016 10:37 am
by Pavel
Hi,

Please check generated message in the correspondent email queue, en_email_message, record.
If this message contains <LIST.txt> there, it would mean that email message is created successfully, and the problem is caused by either SMTP gateway or email client.

Pavel

Re: ‘<>’ are just cut in Email notification

Posted: Tue Dec 20, 2016 12:36 am
by apugazhenthy
Dear Pavel,

I can see the missed text in email queue message body but all the text in the body content are in HTML formatted text.

CQ3.JPG
CQ3.JPG (34.51 KiB) Viewed 2389 times


As per my understanding during the HTML parsing only "<LIST.txt>" get cut in the email body.

Could you please provide your view and solution for this issue.


Many Thanks,
Pugazhenthy A

Re: ‘<>’ are just cut in Email notification

Posted: Tue Dec 20, 2016 8:50 pm
by Pavel
apugazhenthy wrote:As per my understanding during the HTML parsing only "<LIST.txt>" get cut in the email body.
Could you please provide your view and solution for this issue.

Since you are using HTML, you need to replace special characters with escape sequence.
For instance, "<" should be replaced in HTML message with "&lt;" and ">" with "&gt;"
It can be easily achieved using user-defined function.

Code: Select all

use CGI qw(:standard escapeHTML);
return escapeHTML(shift);


Pavel

Re: ‘<>’ are just cut in Email notification

Posted: Wed Dec 21, 2016 5:08 am
by apugazhenthy
Pavel wrote:It can be easily achieved using user-defined function.

Code: Select all

use CGI qw(:standard escapeHTML);
return escapeHTML(shift);



Dear Pavel,

Thanks for your valuable time and consideration.

created new udb_property with the code you provided and named it as Escapechar.

Esc.JPG
Esc.JPG (31.39 KiB) Viewed 2376 times


Now I am wondering where to call this function, whether at Email rule body or somewhere else like message header.

Could you please clarify on my query?


Regards,
Pugazhenthy A

Re: ‘<>’ are just cut in Email notification

Posted: Wed Dec 21, 2016 6:35 am
by Pavel
apugazhenthy wrote:
Pavel wrote:It can be easily achieved using user-defined function.

Code: Select all

use CGI qw(:standard escapeHTML);
return escapeHTML(shift);



Dear Pavel,

Thanks for your valuable time and consideration.

created new udb_property with the code you provided and named it as Escapechar.

Esc.JPG

Now I am wondering where to call this function, whether at Email rule body or somewhere else like message header.

Could you please clarify on my query?


Regards,
Pugazhenthy A


You suppose to call it in the email notification rule message body, to escape fields that might contain special characters. For instance, if you use field "Description",

Code: Select all

...
Escapechar($Description)
...

Pavel

Re: ‘<>’ are just cut in Email notification

Posted: Wed Dec 21, 2016 11:04 am
by apugazhenthy
Thanks a lot Pavel..
It's working fine now... :D