[SalesForce] The record couldn’t be saved because it triggered an email alert that failed

Staff user is a member of Queue 1 attempting to transfer a record to another team which works out of Queue 2.

When updating the owner to Queue 2 and saving the record the following error displays. This error is triggered by a WFR which sends an email alert. (The email template in the email alert is accessible by the user)

enter image description here

Due to the email alert failing, the record remains in Queue 1.

If I remove the email alert from the WFR, the record changes to Queue 2 as desired.
If I remove all but the related: staff user from the email alert the record transitions as desired.

The email alert appears to be failing, because NON queue members were included in the email alert. This appears to also include related users (Owner, Client, etc).

I've reviewed the debug logs/logged in as the user and can reproduce, but can't locate a specific error message confirming the diagnosis.

Can I have a email alert notify the client, the queue members and the person transitioning the record to Queue 2 (if all parties don't have membership in Queue 2)

Best Answer

You can create multiple email alerts based on your workflow rule.

  1. For new owner (queue or a person)
  2. For Client
  3. Previous Owner

This will separate it out and help in the reduction and better diagnosis of any failure.

The real trick is notifying the previous owner on the record as he/she(userId) is no longer present on the record to send an email to.

To get around this I would suggest creating a technical field and updating it in Before Update trigger with previous owner value when a record is transferred and then sending him/her an email alert from the workFlow.

Related Topic