alexed1 / LightningFlowComponents

A collection of unofficial Flow extensions that can be used to enhance Salesforce Flow and Orchestrator.
http://unofficialsf.com
Other
585 stars 575 forks source link

SendBetterEmail - v2.2.1- Emails not being sent out from a flow triggered by Guest User #1040

Open bottomlinebrokers opened 2 years ago

bottomlinebrokers commented 2 years ago

We have a Salesforce community as our public website (blbrokers.com), where we allow tasks such as completion of forms, registration, and login. Users can complete these forms either when logged out (as the SF guest user) or logged in (as a registered user).

We have a record-triggered flow that runs when a record is created, after the record saves. This flow sends an email to one of our SF users, so they can respond when a website form is completed (Examples on our site: /contact, or /become-a-business-broker). The email is sent using Send Better Email (v2.2.1). This flow works perfectly when (1) the record is manually created by one of our users logged into SF (bypassing the website entry), or (2) when one our registered users is logged into the website. However, the SBE DOES NOT send at all when the form is completed by a user who is not logged in to the community (therefore, they're submitted under the guest user). The flow does not crash in any way ... simply nothing.

Our SB usage:, we send using a Lightning email template, to a SF Account, from an organization-wide address (the special purpose org-wide Default No-Reply email address, & yes, it's verified). This is my standard approach in all my flows, and it works without issue in other flows that are triggered by internal users.

My flow works fine in the guest user scenario if I substitute the SF standard Send Email (emailSimple) core action, but this approach has limited functionality, so I'd STRONGLY prefer not to do that. Downsides: it won't leverage my library of Lightning Email Templates, and it won't use the Default No-Reply Address. It insists on using the Automate Process User Email Address, which won't allow you to use the Default No-Reply address. Plus, it doesn't leverage some stock subflows I've built around emailing. It's a poor choice.

I've tried the following troubleshooting steps:

Permissions seem fine, since the standard SF core action works in all 3 scenarios without issue.

I've tried adding (a verified) user-selectable organization-wide email address and sending via SBE from that address; that also did not work. I thought maybe it was some strange restriction around the special purpose email address.

I downloaded a simple email log for your review (see attachedf). There are two events; one successful (with the "R" in the Mail Event column, when I created a record manually) and one unsuccessful (our test case, with a "D" in the mail event column, triggered by the guest user). I don't know how to leverage this information, but I hope it's useful to you.

Please advise; we're stuck. Thank you in advance and kindly!

Mark EmailLog_1-24-2022_CbCiGAK_1.csv

bottomlinebrokers commented 2 years ago

Any update on this issue? This is a bit of a showstopper for us....

jdpond commented 2 years ago

Sorry so long to look at this. Quick suggestion to try would be to make a subflow with system as the user and include the sendBetterEmail action inside of it. Might work as long as your security team doesn't get wind of it :) Will look at alternative development possibilities

bottomlinebrokers commented 2 years ago

Tried that, no dice. I'm going to try some of the "run flow as a guest user" stuff that has come out in the last 2 releases.

I will keep you posted....and I'm a sole admin, so I am the security team.

Mark


From: Jack D. Pond @.> Sent: Monday, October 10, 2022 8:50 PM To: alexed1/LightningFlowComponents @.> Cc: Mark Pieter @.>; Author @.> Subject: Re: [alexed1/LightningFlowComponents] SendBetterEmail - v2.2.1- Emails not being sent out from a flow triggered by Guest User (Issue #1040)

Sorry so long to look at this. Quick suggestion to try would be to make a subflow with system as the user and include the sendBetterEmail action inside of it. Might work as long as your security team doesn't get wind of it :) Will look at alternative development possibilities

— Reply to this email directly, view it on GitHubhttps://github.com/alexed1/LightningFlowComponents/issues/1040#issuecomment-1274049759, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKNO7TE7ID4B6L6LOLECI6TWCTPX3ANCNFSM5NP2DOYQ. You are receiving this because you authored the thread.Message ID: @.***>