Email script token as recipient for sending alert | Community
Skip to main content
ggerla
New Participant
July 18, 2023
Solved

Email script token as recipient for sending alert

  • July 18, 2023
  • 2 replies
  • 2203 views

Hi there, I'm trying to use an email script token as a recipient for an email alert. I'm using this because the choice rules on the Flow are too way restricted for my necessity. The following is an example of what I'm doing.

 

The token itself works correctly: if I use it within the body email, it will be resolved correctly to the correct email address, but if I use it as a recipient, it is not working.  If I'm looking into the log, I can see the step executed correctly, but I'm not seeing the resolved token, just the name.

 

 

The main question is: can I use an email script token as an alert recipient? Second one: why it is not working?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

You can’t use Velocity/Email Script tokens outside of emails themselves, i.e. they can’t determine recipients.

2 replies

SanfordWhiteman
New Participant
July 19, 2023

Please return to your thread and check responses, @ggerla.

ggerla
ggerlaAuthor
New Participant
July 19, 2023

Thanks for replying.

Is there another way to manage complex conditions to determine which recipient needs to receive the notification, which shouldn't involve the lead's fields?

Unfortunately, as I said, the choice condition within the flow is not flexible and scalable.

SanfordWhiteman
New Participant
July 19, 2023

Only way that comes to mind is calling a webhook-compatible service that applies whatever logic you want and then writes the address to a lead field. That {{lead.token}} is then used in Send Alert. Of course I’d like to see what logic you’re really using, what logic (and non-lead objects) you’re consulting in Velocity.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 18, 2023

You can’t use Velocity/Email Script tokens outside of emails themselves, i.e. they can’t determine recipients.