This issue may be outside the scope Blackbaud Support since it is custom solution bringing custom coding into the email, but certainly feel free to create a case using the link below and we'll be happy to see if there is anything that can be done within the scope of support.

Chat with Support and reference this article.