Recently I was dealing with an interesting issue regarding the SplendidCRM marketing system.
Whenever the client sent emails out via the CRM, it would not de-duplicate the emails. Therefore, if the recipient was on two target lists in the campaign they would receive the email twice. Not ideal really.
After much searching I could not find any settings in the CRM which offer the de-duplication of emails, so I decided to come up with my own solution.
After downloading the latest SplendidCRM community edition which comes with all the source code including SQL stored procedures, I dug through the code and found that the send email function was using the spCAMPAIGNS_SendEmail stored procedure.
I decided to update this stored procedure so that it marks any duplicate email as deleted when the campaign is sent, and now the recipients only receive the email once. I found this to be the most efficient and cost effective solution for our client.
Please click here to download the updated SQL query for the stored procedure.
Please note: Should you apply this updated stored procedure, please be aware that it supplied as is and applied at your own risk. You should ensure adequate backups are in place and that you apply any appropriate testing for your environment.