Quote:
Originally Posted by Liox Hello again,
today I had a closer look at the ZmZimletBase. js and the ZmMailMsg. js scripts. Voila I found the solution myself.
There is a prototype in the ZmZimletBase. js named "onMsgView" which will called every time you view a new message.
Here a example javascript : Code: function GetFromAddress() {
}
GetFromAddress.prototype = new ZmZimletBase();
GetFromAddress.prototype.constructor = GetFromAddress;
GetFromAddress.prototype.onMsgView =
function(msg, oldMsg){
var from = msg.getAddress(AjxEmailAddress.FROM);
alert(from);
}; And the appropriate XML File: Code: <zimlet name="GetFromAddress" version="1.0" description="Get the sender address and print an alert">
<include>getFromAddress.js</include>
<handlerObject>GetFromAddress</handlerObject>
</zimlet> Hope this helps someone else... |
Hey Liox , Thanx for the post it helped me a lot ..
But i didnt create a new zimlet for that ... Since its giving error after deploying .. I am new to zimlets . i created the XML and the
JS file as you have posted ...
Am getting the following error in mailbox.log
2009-06-25 09:54:31,270 INFO [btpool0-7] [name=zimbra;ip=10.200.220.186;] soap - DeployZimletRequest
2009-06-25 09:54:31,272 INFO [Thread-480] [] zimlet - deploy
java.io.FileNotFoundException: zimlet description not found: GetFromAddress.xml
at com.zimbra.cs.zimlet.ZimletFile.initZimletDescript ion(ZimletFile.java:199)
at com.zimbra.cs.zimlet.ZimletFile.initialize(ZimletF ile.java:191)
at com.zimbra.cs.zimlet.ZimletFile.<init>(ZimletFile. java:146)
at com.zimbra.cs.service.admin.DeployZimlet$DeployThr ead.run(DeployZimlet.java:96)
at java.lang.Thread.run(Thread.java:595)
if u can plz explain me the above .
so what i did is used the function in some other zimlet (ie i edited another zimlet ) and am getting the from address from there .
Another Querry ::
Is it possible to get the From address or the Subject without using the onMsgView Function .
What would u suggest if i need these values(from and subject) inside an Already existing function .
Many Thanx in Advance