Hi,
your first problem is to get it "from outside".
In my opinion you have to use an ajax call calling a php script that reads the code from a file or out of a database.
something like:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
$.post('https://www.domain.de/test/getCode.php', function(data) {
$('#question{QID} input[type="text"]').val(data)
});
$('#question{QID}').hide();
});
</script>
The php script "getCode.php" has to retrieve the code; and make sure that it is unique.
You can pass a parameter to select a code depending on that parameter, e.g. {SAVEDID} - which is unique.
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
$.post('https://www.domain.de/test/getCode.php' , { id: "{SAVEDID}"},function(data) {
$('#question{QID} input[type="text"]').val(data)
});
$('#question{QID}').hide();
});
</script>
The rest is easy. Use EM to insert the code in your mail.
But as long as you do not provide a sample it's difficult to help
Joffm