How to change email template contents via SQL backend?

Version 3

    How to change email template contents via SQL backend?

     

    Below a sample query and the related short video, which may help customers to understand how E-mail template body update queries work.

    It must be clear that all information is provided as-is and without any warranty.

    Also, it is strongly recommended to make sure to have a full running backup prior changing the content of the templates and any backend changes are not sync-aware.

     

     

    DECLARE @SEARCH AS VARCHAR(100)

    DECLARE @REPLACE AS VARCHAR(100)

     

    -- What should be searched and replaced?

    SET @SEARCH = 'GoldMine (a division of Ivanti)'

    SET @REPLACE = 'GoldMine© (a division of Ivanti®)'

     

     

    UPDATE MAILBOX

    SET RFC822= REPLACE(CONVERT(VARCHAR(MAX),CONVERT(VARBINARY(MAX),RFC822)) ,@SEARCH, @REPLACE)

    WHERE CONVERT(VARCHAR(MAX),CONVERT(VARBINARY(MAX),RFC822)) LIKE '%'[email protected]+'%' and folder = 'X-GM-TEMPLATES'

     

    How to change an email (template) content via SQL