SFDO-Community / Summit-Events-App

Salesforce Event System developed at the University of St. Thomas
BSD 3-Clause "New" or "Revised" License
58 stars 56 forks source link

Developers - Transactional Emails in Base Package #85

Closed tcdahlberg closed 3 months ago

tcdahlberg commented 4 years ago

During the recent removal of EDA dependency in the project TDTM triggers needed to be removed. One of these triggers was responsible for sending out transactional emails as statuses changed on the registration record. A new way needs to be imagined to make these emails send in the base package of Summit Events App. It may be possible to use a lighting flow with APEX actions to achieve this without creating triggers and a framework for those triggers.

jhilyard commented 4 years ago

Based on this reference: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm I think we should abandon the idea of wrapping lightning web components inside aura components inside visualforce pages (which was proposed to have the same action overrides for Salesforce Classic UI orgs and Salesforce Lightning UI orgs, i.e. to "write once") for Summit_Events_Email new/edit forms, and have separate implementations for editing Summit_Events_Email in Lightning UI (an App Page with several intercommunicating LWC -- no Aura needed if we don't use action overrides) and Classic UI (could be done as traditional Visualforce new/edit action overrides similar to the current "select Letterhead" action).

Here's the key section below; I think it's fighting the trend of modern browsers towards increasingly restrictive (secure, private) default settings. I don't think the original VF/Aura/LWC idea would be viable in default Safari right now:

Browser Third-Party Cookies

Lightning components set cookies in a user’s browser. Since Lightning components and Visualforce are served from different domains, those cookies are “third-party” cookies. Your users need to allow third-party cookies in their browser settings. For more details, including the requirement to disable the Prevent cross-site tracking setting in Safari, see Lightning Out Requirements.

jhilyard commented 3 years ago

With Spring '21 release it's now possible to use Flow or Process Builder to send Lightning Email Template emails leveraging the Email Builder from Winter '21. These email alerts are not subject to the 5,000 email limit (unlike Apex sends). This new native functionality provides a UI to select a lightning email template for an Email Alert, and that action can be placed behind Flow/Process/Workflow decision nodes to match registration status, related event fields, etc. The downside is that it requires an admin to build the Email Action and Flow, so delivering this would empower non-admin events users and for smaller orgs the 5,000 daily email limit may be plenty. LWC still can't be used for standard action overrides or custom actions, so either an LWC component to select the template would need to wrapped in an Aura Component for "new"/"edit", or an alternative interface (something other than a Summit Events Email record detail page) would need to be designed -- potentially this could be a custom LWC that acts as a Summit Events Email related list on an Event record detail page.

rdblake21 commented 3 months ago

Triggered emails are a part of the base package. Creating a new issue for the Email Enhancement that leverages Lightning Email Templates for enhanced and native functionality.