0

I have a simple web-to-lead that works as expected. What I want to do is send a copy of the form details if the lead meets a certain condition. Condition being:

LeadSource = "example".

The email that I want to send a copy of the lead to is a user on the account. I have created an email template that I would like it to use so that certain fields can be omitted in the copy. That looks like so:

{!Lead.Id}

NEW LEAD .... 

First Name: {!Lead.FirstName}
Last Name: {!Lead.LastName}
Email: {!Lead.Email}
Phone: {!Lead.Phone}
Company: {!Lead.Company}
Country: {!Lead.Country}
State: {!Lead.State}
City: {!Lead.City}
Lead Source: {!Lead.LeadSource}
Inquiry Details: {!Lead.Inquiry_Details__c}

This is how I want the email to be formatted when the new lead is created (from web-to-lead). I don't know much about how to get this to work in salesforce, but I started using an email alert. This email alert uses the template created above. The recipient-type is specified as the user I want the email copy to go to. Let's say it's [email protected].

Next, I tried to trigger that email alert using a flow. The flow is structured as so:

VISUAL


START

  • Record-Triggered Flow

    • Object: Lead
    • Trigger: A record is created
    • Conditions: 1 (condition: LeadSource = "example")
    • Optimize for: Actions and Related Records
  • EMAIL ALERT

    • alert created (previously mentioned)
    • Record ID: {!$Record.Id}

END


Whenever I run a test and chose a lead to test it on it shows completed with no errors. However, I am not getting the email sent to my inbox.

Summary:

  1. New lead created from web-to-lead with LeadSource = "example"
  2. Send a copy of that lead via email using a desired email template to a specific email address.
  3. Also, maintain the lead in the original lead area on SF.

-- I don't have much preference as to how this is accomplished, as long as it works.

7
  • What does user on the account mean? are we talking about the Lead.Owner?
    – cropredy
    Mar 7, 2023 at 23:54
  • @cropredy You know how when you set up the email alert and it says Recipient Type? That is set to user and the user is listed in the Available Recipients. So yes, perhaps that may be the same as the Lead.Owner.
    – user
    Mar 8, 2023 at 0:08
  • ah - so the emails should go to a fixed user(s). Do you have email deliverability turned on for your sandbox/scratch org?
    – cropredy
    Mar 8, 2023 at 0:46
  • @cropredy I am pretty sure. Do you know how to check to make sure?
    – user
    Mar 8, 2023 at 0:47
  • setup | deliverability | All emails; you can also turn on debug log and you can see if your flow started and executed the email alert
    – cropredy
    Mar 8, 2023 at 1:28

1 Answer 1

0

Everything you have done so far is correct.

Perhaps, it is the way you are testing it. I imagine you have your flow deactivated and are running your test with the debug feature and are selecting a lead, etc.

However, you are using a Record-Triggered Flow with the trigger being A Record is Created. When you are running the test and selecting a record, there is no record creation process in effect.

If your test keep returning as completed. Try activating your flow and submit a new lead via your web-to-lead. This lead creation should trigger your flow and the events within.

1
  • This did it - thank you!
    – user
    Mar 9, 2023 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .