Send email from inside custom code action

Hello,

We created a custom code action which is used in different workflows in our production environment. Every time this scripts fails we want to notify some users at HubSpot about it. Is there a notification mechanism we can use for it from inside a custom code action? Can we send email messages from inside a custom code action?

Thanks in advance for your help with this!

Hello @jgranados .

Throwing @kierana at this for some of his sage advice :grinning_face:

We implemented a workaround by creating and connecting to an external service which sends the email. I have created an “idea” suggesting HubSpot to allow using AWS S3 SES from inside the custom code actions in order to send emails: https://community.hubspot.com/t5/HubSpot-Ideas/Send-email-from-inside-custom-code-action/idi-p/420927#M78142

Cosnider it upvoted :+1:

@jgranados ming sharing a screenshot? I haven’t be able to find a way to do it in a workflow - they do not have ability to select the code execution result as an if/then branch. We have tried to do things like create a custom property, set that property with the copy value function, then trigger… but what a hassle. You just doing it inside the code as another API call?

Hi @jgranados ,

My name is Megan and I’m a product manager for the workflows tool. Your post caught my attention, because we’ve just launched a new type of branch in workflows, that lets you branch on outputs from previous workflow actions, called Simple Branch. This means, you could add your own unique outputs to your custom code action for error handling, and/or leverage our default action output for the success/fail state of an action. You could use this branching to split off the workflow and go to a notification action next, if there’s a failure. If you’d like to check this feature out and don’t yet have access, please send me a message with your HubID and I’d be glad to have you try it out and give feedback.

Best,

Megan