Can We Add Mail Script To The Quick Message?

manas5
Tera Expert

I just wanted to ask, can we call a mail script in Quick Messages?
Navigate to Quick Messages
in the body, I am trying to call a quick message script:


and the script goes like:


to my understanding, this script would just fetch the phone number of the current logged in user and display it in the email body, but when I am trying to use this script as explained above, it just shows me the coded line: ${mail_script:phone_number_ea}
My real question is, is it even doable? like can we call a mail script in quick messages?

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @manas ,

in quick messages any mail script calls are ignored.

As a workaround you could simulate the mail script behaviour by implementing a business rule that would replace placeholders with some output:

Business Rule

  • Table: sys_email
  • Active: true
  • When: "before" on "Insert" and "Update"
  • Condition: "Type" = "sent-ready"

find_real_file.png

In the script section you have to implement some code that

  1. searches for any placeholders you had defined before, for example
    • {Signature}
    • {Phone Number}
  2. replaces that placeholders with corresponding contents

 

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

View solution in original post

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @manas ,

in quick messages any mail script calls are ignored.

As a workaround you could simulate the mail script behaviour by implementing a business rule that would replace placeholders with some output:

Business Rule

  • Table: sys_email
  • Active: true
  • When: "before" on "Insert" and "Update"
  • Condition: "Type" = "sent-ready"

find_real_file.png

In the script section you have to implement some code that

  1. searches for any placeholders you had defined before, for example
    • {Signature}
    • {Phone Number}
  2. replaces that placeholders with corresponding contents

 

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Hi @manas ,

Did my reply answer your question?

If so, please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

If not, please tell me what you are still missing!

Kind regards
Maik

or you can configure a Client Template instead. Can't achieve this using Quick Message. Scripts are not supported there. Also, gs.getUser().phone is not a valid They will have to do a glideRecord to sys_user table and then get the user object and then get phone number.