Send different email when Deal is created based on Products name

Hi Community,

I’m a newbie here and hope someone could help me with the following question.

When a Deal is created, with at least one product, I need to send an email based on the product’s name to different recipient.

I’ll try to explain the desired workflow.

If Product A is added to a new Deal, on save, an email is sent to, if Product B to and so on. In case Product A and Product B are added to the same Deal I need to send two different emails.

I have tried using the Automation Workflow but without fortune.

Any suggestion?

Thanks in advance.

Hi @Matteo_Rossi

I’ve tried to set up Workflow automation for this case but I am afraid it will not cover your case, as you could make it to send an email when deal was updated but not taking into account products.

As an option you could subscribe to Webhooks (deal update event), and here is some pseudo-code for a webhook handler that could cover your case

// request body includes "current" and "previous" state of a deal

if current.products_count > previous.products_count then
// some product were added to a deal
// let's get list products attached to a deal

make request to GET /deals/{}/products

for every product in deal products
    send an email if it was not send before

Here is API to get list of deal products!/Deals/get_deals_id_products
Here is info about Webhooks

What do you think about it?

Hi @mykhailo,

thanks for your reply.
Your suggestion is my very first Plan B, but I was hoping for something low-code, so that admin users could keep independently.