Hello,
I have below html script in the email body template in a google doc. But it does not show a button rather it shows the code.
Help me to correct the code.
In order to approve, please click the Approve button below. And also please whether the image source url is also correct?
<<HYPERLINK(CONCATENATE('https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=',[NFA Request No.],'&Option=Approve','> <img src="https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-" width="200">’))>>
Please note that I am using email body template for sending workflow mail.
Thanks.
It still gives error as below. Captured from the log. I tried copying the raw as well as inserting image into the email body template.
"Errors": "Error: Workflow rule 'Send 1st Email' action 'Task Send 1st Email' Body template. Expression 'HYPERLINK(CONCATENATE('https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=',[NFA Request No.],'&Option=Approve','><img src=\"https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-\" width=\"200\">’))' is invalid due to: HYPERLINK has invalid inputs.",
Steve
March 21, 2021, 4:24pm
3
Everything in the HYPERLINK(...)
expression is wrong.
Can you please guide me to correct it? I don’t know HTML and how to mention in the email body template. I have been trying since last few days but unsuccessful. Basically my need is to give two buttons in the email to the users to Approve or Not Approve a workflow. For which I have written a script (as per " Executing a DeepLink action from an Email Silently " and trying to call thru the button.
But unable to reach first step of providing button in the email.
Steve
March 21, 2021, 4:38pm
5
I doubt this will work, but it should at least fix the error:
<<HYPERLINK("https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=" & ENCODEURL([NFA Request No.]) & "&Option=Approve")>><img src="https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-" width="200">
1 Like
Thanks. Let me try this one and give you feedback.
You said doubt about the method, can you suggest the solution for this entire functioanlity?
Regards,
Steve
March 21, 2021, 4:43pm
7
Rajan_PACHCHIGAR:
can you suggest the solution for this entire functioanlity?
I cannot. I’ve never attempted to do such a thing. @LeventK ’s post is the best resource I’m aware of. Unfortunately, he is no longer a regular contributor to the community, so we can’t ask him for help.
I copied as per your suggestion as below in the email body template in google doc, but still gives the error.
<<HYPERLINK("https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=" & ENCODEURL([NFA Request No.]) & "&Option=Approve")>><img src="https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-" width="200">
"Errors": "Error: Workflow rule 'Send 1st Email' action 'Task Send 1st Email' Body template. Expression 'HYPERLINK(\"https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=\" & ENCODEURL([NFA Request No.]) & \"&Option=Approve\")' is invalid due to: HYPERLINK has invalid inputs.",
Steve
March 21, 2021, 4:55pm
9
Ah, the clickable text is required. Try this:
<<HYPERLINK(("https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=" & ENCODEURL([NFA Request No.]) & "&Option=Approve"), "<img src='https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-' width=200>")>>
See also:
1 Like
Hello,
The output came like below screenshot.
1 Like
Steve
March 21, 2021, 6:16pm
11
Okay, that’s not entirely surprising. Does the link work, at least?
Yes, it at least sent the email. But the clickable button did not appear.
1 Like
Steve
March 21, 2021, 6:23pm
13
Try this instead of what we tried above:
<a href="https://script.google.com/macros/s/AKfycbyYZb6AEV3vf4zKJNrsVxq7vj-Aeqw3mLT_n3vf-gf-2cgEp2E/exec?ID=<<ENCODEURL([NFA Request No.])>>&Option=Approve"><img src="https://drive.google.com/uc?export=view&id=1A46QtbEPdQXS2qH65Gslzbf0tJ6GAv0-" width="200"></a>
1 Like
Steve
March 21, 2021, 6:33pm
15
What I just posted should entirely replace the <<HYPERLINK(...)>>
stuff. Did you do that? Perhaps post a screenshot of your template?
Yes, I replaced. Below is screenshot of the template.
1 Like
Just to inform, that I tried running the API script from an HTML editor to change value of a column, it worked. However, it did not trigger the workflow in the App to take next steps or trigger another workflow email.
I think that can be handled using Automation (Bot).
But, the first point has to be solved to show buttons in the email.
Thanks.
1 Like
Steve
March 22, 2021, 12:52pm
18
If you omit the < a href=...>...</a>
wrapper and include only the <img src=...>
tag, does the image display in the generated report?
Nope. See below. Alternatively, can we have two links, one for clicking Approve and another for clicking Not Approve.