Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Button in email notification

swapnil15
Tera Contributor

Hello,

I have a notification which has content as below:

swapnil15_0-1701098341892.png

 

 

Ask is to create a button in red color with text as 'start survey' on the button. And once a user clicks on the link it will redirect to the survey page. As of now the word 'Customer Satisfaction Survey' has link. The link is generated by two mail scripts. I want to use this link obtained from two mail scripts under the newly created button.
PS: I have tired using '<a href="${mail_script:ergo_csm_url_on_portal}?id=take_survey&instance_id=${mail_script:ergo_csm_survey_id}" style="background-color: red; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px;">Take the Survey</a>' in notification but it gave me plain text. 

Also, I used  '<button style="background-color: red; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">Start Survey</button> but it did not helped.
'

 

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, unfortunately your screenshot does not make your configuration clear.
But I do not think that you can consume\call mail_script in the way you appear to be trying to

and I would recommend that you create your button\link in a mail_script (using standard html),

then return the results from the mail_script using template.print(yourButton) as last entry in the script;
So that the button is added to the email body when you call the mail_script from within your notification.

${mail_script:yourButtonScript}

Hi Tony,

Can you help me with the button script?