Note: the project uses an external library (Lumisoft.Net), ILMerge will merge this library with the project library when building the project in Visual Studio.
See also: https://community.superoffice.com/documentation/SDK/SO.Web.Application/html/CustomAjaxMethods.htm
-
Go to the installationfolder of SoWeb (C:\Program Files\SuperOffice\SOWeb8)
-
Register assembly:
- Copy file "Ctse.SO.AjaxTest.dll" to the subfolder \bin\
- Open the file "web.config", change:
<Factory> <DynamicLoad> .... <add key="Ctse" value="Ctse.SO.AjaxTest.dll" /> </DynamicLoad> </Factory>
- Add JavaScript:
- Go to subfolder \JavaScripts\ and create subfolder "Ctse" and place file "ctse.so.ajaxtest.js"
- Go to subfolder \App_Data\WebClient\Web\SystemFiles\ and open the file SoApplicationConfiguration.config"
- Change:
<jsincludes> ... <jsinclude path="~/JavaScripts/Ctse/ctse.so.ajaxtest.js" /> </jsincludes>
- Add button or menuitem in SOWeb
Add a button/menuitem from where the action (generating the email) should be fired.
For example take a look in the file \App_Data\WebClient\Web\Menu\SoMenuConfiguration.config
In the button/menuitem definition make the call to the JavaScript (note that all files - mailtemplate and attachments - should be in the \so_arc\template\ folder on the server):
<url>javascript:GenerateEmailWithAttachments(mailTemplateName, contactId, personId, projectId, saleId, attachmentFileNames);</url>
for example (set the ids on 0 if they are not applicable, attachmentFileNames can also be an empty string if no attachments should be added):
GenerateEmailWithAttachments('test1.somail', 1, 2, 0, 0, 'attachment1.pdf,attachment2.pdf,attachment3.pdf')
- Restart the IIS