I want to replace the emailtemplates of a survey. as only superadmins should be able to change the default texts I wanted to get the texts in the plugin configuration.
later on on every save of the survey it's mail-templates should be replaced.
I got the fields to enter the value in the plugin configuration and it's content is saved in the table
lime_plugin_settings.
as the mail templates are stored in
lime_surveys_languagesettings I tried to hook into the save event.
$this->subscribe('beforeSave');
$this->subscribe('beforeSurveyLanguagesettingSave');
but those functions got not triggered
[hr]
on the other side I noticed:
every time I save the survey, the mail templates are wrapped in a HTML page:
Code:
<html>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
:
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<head>
<title></title>
</head>
<body>my template text</body>
</html>
and with each save another line
Code:
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
is inserted. (my text stays in the body-tag).
[hr]
hooking into
beforeSurveySave works without problems, but I can't hook into the other ones to modify the mail templates.