Recently some of my AMPScript calls raised errors which they did not do before.
I call most of my AMPScripts inside a variety of different blocks (HTMl, Text, Image, ...) with the function ContentBlockByKey like this
When i recently opened one of my template emails some of those functions crashed because " were interepreted as
" which makes the function raise an error: Object reference not set to an instance of an object.
I did not touch the working template before, but when i did further investigation, i saw the following:
When you touch an TextBlock with working AMPScript inside it (historicly inserted in the HTML-Editor of the Content Tab, when you create an email) it automaticly opens the Content View instead of the HTML Editor and saves itwhen you click on Done Editing. The result is that the " become
" and the AMPScript fails (obviously).
So my questions would be:
- Can i do something to prevent this? [users without programmatic knowledge may not understand this]
- Wouldn't it be better that the content inside AMP-Script Blocks %%[ ]%% or %%= =%% or %% %% will not be interpreted at all?
Unrelated question: How can you insert a string containing " into a variable?
Thank you very much