Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-2008, 11:54 AM
Trained Alumni
 
Posts: 343
Default [SOLVED] Problem grabbing info from object in doDrop

This bit of code is in my Zimlet JS. The problem I'm having is the obj.from/participants/attendees is not returning what I think it should.

I'm expecting that to be something like this...
"Joe Smith <j-smith@dom.edu>"

However it is only giving me the name like this...
"Joe Smith"

Which doesn't help me because I need the email address. Can anyone help or tell me what I'm doing wrong?

Matt

Code:
Edu_Wiu_Directory.prototype.doDrop = 
function(obj) {
........
	//get uid from various drag n drops in Zimbra
	if (obj.TYPE == "ZmMailMsg") {
		result = this.grabEcomEmail(obj.from);
	} 
	else if (obj.TYPE == "ZmConv") {
		result = this.grabEcomEmail(obj.participants[0]);
	}
	else if (obj.TYPE == "ZmAppt") {
		result = this.grabEcomEmail(obj.attendees[0]);
	}
........

Last edited by Chewie71; 12-18-2008 at 12:15 PM..
Reply With Quote
  #2 (permalink)  
Old 12-22-2008, 02:54 PM
Zimbra Employee
 
Posts: 187
Default

emailObj has address, dispName, name(fullname) and type. you need to grab the address

something like..
Edu_Wiu_Directory.prototype.grabEcomEmail = function(emailObj) {
return emailObj.address;
}
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 12-22-2008, 05:21 PM
Trained Alumni
 
Posts: 343
Default

My mistake....I was printing it out to a web dialog box.....and it was interpreting the <jsmith@here.com> part of the FROM as an HTML tag....so only presented me with the name part of the address.

Just me being dumb I guess...

Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.