[xwiki-devs] Calling Email from user
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name How would I get the email address for a document author and or the last person that modified the document? Grant Sales Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r) --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ============================================================================================
Hi, On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue()) Guillaume Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
============================================================================================ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') $userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($doc.c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table> {{/html}}{{/velocity}} Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help! But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list. ~Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Hi, On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue()) Guillaume Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not
an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission
and delete the message without copying or disclosing it.
====================================================================== ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email) {{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') $userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($doc.c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table> {{/html}}{{/velocity}} Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help! But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list. ~Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Hi, On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue()) Guillaume Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not
an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission
and delete the message without copying or disclosing it.
====================================================================== ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email)
Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailApplication
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail')
This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail) $escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($doc.c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not
an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission
and delete the message without copying or disclosing it.
====================================================================== ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Looked at the code. Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes. I also don't really know where to load the plugin or how to call in in the document. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email)
Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailApplica tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail')
This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail) $escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($doc .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc. da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not
an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any
attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission
and delete the message without copying or disclosing it.
===================================================================== = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email)
Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailApplica tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail')
This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($doc .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc. da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any
attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
===================================================================== = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them) Mail Sender Plug in. What is all the @'s for. (@pram to the recipient of message) do I put the email before or after that. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in
the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email)
Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppli ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail')
This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html
block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($do c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem
to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is
confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any
attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
==================================================================== = = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
@param is javadoc to tell you what the parameters are that you pass to the function. If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-invitat... The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer) This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig) Caleb Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in
the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email)
Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppli ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html
block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($do c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem
to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is
confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
==================================================================== = = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
I'll try that, Is there a way to call the xwiki.user's email and put that in the sender's email? As in the from email will be dynamic (many employee's) and the to will be static (one boss, xwiki.specificuserName) -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user @param is javadoc to tell you what the parameters are that you pass to the function. If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-inv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer) This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig) Caleb Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a
way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to
a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in
the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in
this template so when the user saves the new page it will also email
it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html
block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the
table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem
to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is
confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender
by reply transmission and delete the message without copying or disclosing it.
====================================================================
= = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
3 things. . . . 1 @import "mynewfile.css"; isn't overrideing the skin like it should, tried with it in the objects class porperties as well 2 How can I make my first section of velocity code my email's body content? 3 Need to get my button to work, all I see is -1 in the wiki page. @import "mynewfile.css"; {{velocity}}{{html}} Posted by: $xwiki.getLocalUserName($doc.creator) <a href="mailto:$xwiki.getDocument($doc.getCreator()).getObject('XWiki.XWik iUsers').getProperty('email').getValue()">$xwiki.getDocument($doc.getCre ator()).getObject('XWiki.XWikiUsers').getProperty('email').getValue()</a
$xwiki.formatDate($doc.creationDate, "EEEE") $xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") <br/> Modified By: $xwiki.getLocalUserName($doc.author) <a mailto:$xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers' ).getProperty('email').getValue()>$xwiki.getDocument($doc.getAuthor()).g etObject('XWiki.XWikiUsers').getProperty('email').getValue()</a> $xwiki.formatDate($doc.date, "EEEE") $xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") {{/html}}{{/velocity}} {{velocity}} #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) ##Set who its from $mailObj.setFrom($xwiki.getDocument($doc.getCreator()).getObject('XWiki. XWikiUsers').getProperty('email').getValue()) ##Set who its To $mailObj.setTo('[email protected]') ## Set the subject line and message body. $mailObj.setSubject('$doc.title') $mailObj.setTextPart('Hello Grant') ## Send the message $sender.sendMail($mailObj, $senderConfig) {{html}} <form action="" id="newmail" method="mail"> <div> <span class="buttonwrapper"><input type="submit" value="Send for approval" class="button"/></span> </div> </form> {{/html}} {{/velocity}} -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user @param is javadoc to tell you what the parameters are that you pass to the function. If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-inv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer) This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig) Caleb --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ============================================================================================
File seems to not be found. . . Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address. ~Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user @param is javadoc to tell you what the parameters are that you pass to the function. If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-inv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer) This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig) Caleb Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a
way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to
a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in
the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in
this template so when the user saves the new page it will also email
it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html
block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the
table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem
to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is
confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender
by reply transmission and delete the message without copying or disclosing it.
====================================================================
= = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue()) should do it. Caleb Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-inv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a
way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplication
Example: I built a FAQ page, and just want the new questions to go to
a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code in
this template so when the user saves the new page it will also email
it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need: http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get it working. Above is my table, this is just a part of the page that I built but the code alone should be working. If you know how to get ride of the
table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender
by reply transmission and delete the message without copying or disclosing it.
====================================================================
= = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
{{velocity}} #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue()) $escapetool.xml($userEmail) $doc.display('userEmail') {{/velocity}} $doc.display('userEmail') Displays nothing $escapetool.xml($userEmail) Displays nothing Shouldn't it be pretty simple? (I tried the code inside {{html}} {{/html}} tags as well. Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Wednesday, June 16, 2010 03:24 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue()) should do it. Caleb Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-i nv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a
way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient
of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplicatio n
Example: I built a FAQ page, and just want the new questions to go to
a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code
in
this template so when the user saves the new page it will also email
it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need:
http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl
i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted
by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d
o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get
it working. Above is my table, this is just a part of the page that I built but
the code alone should be working. If you know how to get ride of the
table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the
last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are
not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender
by reply transmission and delete the message without copying or disclosing it.
====================================================================
= = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Try this: $xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').getProperty('email').getValue() My mistake the object is called XWikiUsers not XWikiUser. Caleb Sales, G. (Grant) wrote:
{{velocity}} #set ($userEmail = $userDoc.getObject('XWiki.XWikiUsers').getProperty('email').getValue()) $escapetool.xml($userEmail) $doc.display('userEmail')
{{/velocity}}
$doc.display('userEmail') Displays nothing
$escapetool.xml($userEmail) Displays nothing
Shouldn't it be pretty simple? (I tried the code inside {{html}} {{/html}} tags as well.
Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Wednesday, June 16, 2010 03:24 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue()) should do it.
Caleb
Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-i nv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient
of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplicatio n
Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code
in
this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need:
http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl
i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted
by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d
o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get
it working. Above is my table, this is just a part of the page that I built but
the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
$xwiki.user.eamil = current user's email address $xwiki.getLocalUserName($doc.author) = Author's First and Last name $xwiki.getLocalUserName($doc.creator) = Creator's First and Last name
How would I get the email address for a document author and or the
last person that modified the document?
#set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales
Security Operations Analyst ING 20 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are
not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
====================================================================
= = ====================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Yes it's my fault, I made the initial typo and didn't see it. Sorry for the lost time incurred :-/ Guillaume On 16 juin 2010, at 23:22, Caleb James DeLisle <[email protected]> wrote:
Try this: $xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').getProperty('email').getValue()
My mistake the object is called XWikiUsers not XWikiUser.
Caleb
Sales, G. (Grant) wrote:
{{velocity}} #set ($userEmail = $userDoc.getObject('XWiki.XWikiUsers').getProperty('email').getValue()) $escapetool.xml($userEmail) $doc.display('userEmail')
{{/velocity}}
$doc.display('userEmail') Displays nothing
$escapetool.xml($userEmail) Displays nothing
Shouldn't it be pretty simple? (I tried the code inside {{html}} {{/html}} tags as well.
Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Wednesday, June 16, 2010 03:24 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue()) should do it.
Caleb
Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application-i nv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient
of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplicatio n
Example: I built a FAQ page, and just want the new questions to go to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code
in
this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need:
http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl
i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted
by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d
o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get
it working. Above is my table, this is just a part of the page that I built but
the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
> $xwiki.user.eamil = current user's email address > $xwiki.getLocalUserName($doc.author) = Author's First and Last name > $xwiki.getLocalUserName($doc.creator) = Creator's First and Last > name > > How would I get the email address for a document author and or the
> last person that modified the document? > #set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales > Security Operations Analyst > ING > 20 Washington Ave South > Minneapolis, MN 55401 > Tel: 612.342.7889 > Fax: 612.342.3428 > Cell: 320.761.0966 > Email: [email protected] > www.ing-usa.com > ING. Your future. Made easier. (r) > > > > --------------------------------------------------------- > > NOTICE: The information contained in this electronic mail message > is > confidential and intended only for certain recipients. If you are
> not an intended recipient, you are hereby notified that any > disclosure, reproduction, distribution or other use of this > communication and any attachments is strictly prohibited. If you > have received this communication in error, please notify the sender > by reply transmission and delete the message without copying or > disclosing it. > > > ==================================================================== > = > = ====================== > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
P*E*R*F*E*C*T*!!! Thanks so much! I've been trying to get that for weeks! Haha. No worries, we have enough projects going on that this is made into my side project. Next step is get a "Send this page as an Email" button to work that will call that user's email address populate it into the "From" put the $doc.title into the Subject field and send the contents of the page in the body. I have plenty of links to look at for that though. But I'm sure I'll end up emailing devs again here at the end of the week. Thanks, Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Wednesday, June 16, 2010 04:16 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Yes it's my fault, I made the initial typo and didn't see it. Sorry for the lost time incurred :-/ Guillaume On 16 juin 2010, at 23:22, Caleb James DeLisle <[email protected]> wrote:
Try this: $xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').get Property('email').getValue()
My mistake the object is called XWikiUsers not XWikiUser.
Caleb
Sales, G. (Grant) wrote:
{{velocity}} #set ($userEmail = $userDoc.getObject('XWiki.XWikiUsers').getProperty('email').getValue( )) $escapetool.xml($userEmail) $doc.display('userEmail')
{{/velocity}}
$doc.display('userEmail') Displays nothing
$escapetool.xml($userEmail) Displays nothing
Shouldn't it be pretty simple? (I tried the code inside {{html}} {{/html}} tags as well.
Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Wednesday, June 16, 2010 03:24 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue() ) should do it.
Caleb
Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application -i nv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient
of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplicat io n
Example: I built a FAQ page, and just want the new questions to go
to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code
in
this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need:
http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl
i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you
probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted
by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d
o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get
it working. Above is my table, this is just a part of the page that I built but
the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
> $xwiki.user.eamil = current user's email address > $xwiki.getLocalUserName($doc.author) = Author's First and Last name > $xwiki.getLocalUserName($doc.creator) = Creator's First and Last
> name > > How would I get the email address for a document author and or > the
> last person that modified the document? > #set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales > Security Operations Analyst > ING > 20 Washington Ave South > Minneapolis, MN 55401 > Tel: 612.342.7889 > Fax: 612.342.3428 > Cell: 320.761.0966 > Email: [email protected] > www.ing-usa.com > ING. Your future. Made easier. (r) > > > > --------------------------------------------------------- > > NOTICE: The information contained in this electronic mail > message is confidential and intended only for certain > recipients. If you are
> not an intended recipient, you are hereby notified that any > disclosure, reproduction, distribution or other use of this > communication and any attachments is strictly prohibited. If > you have received this communication in error, please notify the sender > by reply transmission and delete the message without copying or > disclosing it. > > > ==================================================================== > = > = ====================== > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ============================================================================================
Working code for you guys to share. {{velocity}}{{html}} <table> <tr> <td>Posted by: <td>$xwiki.getLocalUserName($doc.creator) <td><a href="mailto: $xwiki.getDocument($doc.getCreator()).getObject('XWiki.XWikiUsers').getP roperty('email').getValue()">$xwiki.getDocument($doc.getCreator()).getOb ject('XWiki.XWikiUsers').getProperty('email').getValue()</a> <td>$xwiki.formatDate($doc.creationDate, "EEEE") <td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified By: <td>$xwiki.getLocalUserName($doc.author) <td><a mailto: $xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').getPr operty('email').getValue()>$xwiki.getDocument($doc.getAuthor()).getObjec t('XWiki.XWikiUsers').getProperty('email').getValue()</a> <td>$xwiki.formatDate($doc.date, "EEEE") <td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table> {{/html}}{{/velocity}} Looks pretty nice. Would like to know if there is a way to just move that into my skin. Found this in bin/skins/soc/soc.css . . . . (not the whole code but some of it) /* -----------------Top Doc Information------------------*/ #hierarchy { font-size: 90%; padding-top: 15px; } #document-title h1 { font-size: 2.15em; letter-spacing: -1px; margin: 0; padding: 5px 0; } #document-info { color: #888888; font-size: 90%; padding: 3px 0 1em; text-align: right; } .xdocLastModification { float: left; text-align: left; width: 48%; } /* ---------------Bottom Doc Information------------------*/ #xdocFooter { background-color: #FFFFFF; border-top: 1px solid #CCCCCC; color: #888888; font-size: 90%; overflow: auto; padding: 5px 25px 10px; width: auto; } #xdocAuthors { padding: 3px 0; text-align: right; } What I would like to do is add email address in the Last modified by and Created by, and also have them next to each other. Syntax for that though is another whole problem that I will eventually need help with. ~Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Sales, G. (Grant) Sent: Wednesday, June 16, 2010 04:21 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user P*E*R*F*E*C*T*!!! Thanks so much! I've been trying to get that for weeks! Haha. No worries, we have enough projects going on that this is made into my side project. Next step is get a "Send this page as an Email" button to work that will call that user's email address populate it into the "From" put the $doc.title into the Subject field and send the contents of the page in the body. I have plenty of links to look at for that though. But I'm sure I'll end up emailing devs again here at the end of the week. Thanks, Grant -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Wednesday, June 16, 2010 04:16 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user Yes it's my fault, I made the initial typo and didn't see it. Sorry for the lost time incurred :-/ Guillaume On 16 juin 2010, at 23:22, Caleb James DeLisle <[email protected]> wrote:
Try this: $xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').get Property('email').getValue()
My mistake the object is called XWikiUsers not XWikiUser.
Caleb
Sales, G. (Grant) wrote:
{{velocity}} #set ($userEmail = $userDoc.getObject('XWiki.XWikiUsers').getProperty('email').getValue( )) $escapetool.xml($userEmail) $doc.display('userEmail')
{{/velocity}}
$doc.display('userEmail') Displays nothing
$escapetool.xml($userEmail) Displays nothing
Shouldn't it be pretty simple? (I tried the code inside {{html}} {{/html}} tags as well.
Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Wednesday, June 16, 2010 03:24 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
What value did you set $userEmail to? #set ($userEmail = $userDoc.getObject('XWiki.XWikiUser').getProperty('email').getValue() ) should do it.
Caleb
Sales, G. (Grant) wrote:
File seems to not be found. . .
Tried to use $escapetool.xml($userEmail) at the end of my previous block of code and that still wont display a user's email address.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf
Of Caleb James DeLisle Sent: Friday, June 04, 2010 03:15 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
@param is javadoc to tell you what the parameters are that you pass to the function.
If it helps any, here is a live working page which sends email: http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-application -i nv itation/src/main/resources/Invitation/Invitation.xml The interesting part starts on this line: #macro(sendMail, $messages, $config, $emailContainer)
This is all you need to send a simple test message: #set($sender = $xwiki.get('mailsender')) #set($senderConfig = $sender.createMailConfiguration($xwiki)) #set($mailObj = $sender.createMail()) $mailObj.setFrom($config.get('[email protected]')) ## ## fill in an address which you will see when the mail comes in. $mailObj.setTo('[email protected]') ## ## Set the subject line and message body. $mailObj.setSubject('test') $mailObj.setTextPart('Hello world') ## Send the message $sender.sendMail($mailObj, $senderConfig)
Caleb
Sales, G. (Grant) wrote:
Well I tried the HTML export and its 3 pages long. Will the Email be the same? The only page with usefull information is page 3. Is there a way to specify what content is sent from the page. (eg. Email only html table 1 and html table 2 and all the contents in them)
Mail Sender Plug in. What is all the @'s for. (@pram to the recipient
of message) do I put the email before or after that.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 02:12 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Looked at the code.
Not really sure if I understand all that. Is there a more simple way to send an HTML copy of the new page created? You can use the watchlist app but you can't customize it as much. http://code.xwiki.org/xwiki/bin/view/Applications/WatchlistApplicat io n
Example: I built a FAQ page, and just want the new questions to go
to a single specific email address for alert purposes.
I also don't really know where to load the plugin or how to call in in the document. The plugin is loaded by default. #set($mailSender = $xwiki.get('mailsender')) and you have it.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Caleb James DeLisle Sent: Friday, June 04, 2010 12:58 PM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Sales, G. (Grant) wrote:
Also would like to know if there is a way to add some hidden code
in
this template so when the user saves the new page it will also email it to my boss. (defined email or the xwiki admin email) Here's what you will be using: http://code.xwiki.org/xwiki/bin/view/Plugins/MailSenderPlugin This is an implementation of it similar to what you need:
http://code.xwiki.org/xwiki/bin/view/Applications/SendPageByEmailAppl
i ca tion
{{velocity}}{{html}} #set ($userDoc = $xwiki.getDocument($doc.author)) #set ($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set ($userProp = $userObj.get('email')) #set ($userEmail = $userProp.getValue()) $doc.display('userEmail') This is going to look for a property in the doc's "current object" called "userEmail". You have userEmail stored in $userEmail so you
probably want to go $escapetool.xml($userEmail)
$escapetool.xml just escapes the xml entities since you are in an html block.
$userEmail <table> <tr> <td>Posted
by:<td>$xwiki.getLocalUserName($doc.creator)<td>$xwiki.formatDate($d
o c .c reationDate, "EEEE")<td>$xwiki.formatDate($doc.creationDate, "MM.dd.yyyy kk:mm:ss z") </tr><tr> <td>Modified
By:<td>$xwiki.getLocalUserName($doc.author)<td>$xwiki.formatDate($doc.
da te, "EEEE")<td>$xwiki.formatDate($doc.date, "MM.dd.yyyy kk:mm:ss z") </tr> </table>
{{/html}}{{/velocity}}
Still isn't working (or I don't know how to display it right). Basically all I need is to add the top into my table once I can get
it working. Above is my table, this is just a part of the page that I built but
the code alone should be working. If you know how to get ride of the table lines too that would be a great help!
But thanks Guillaume! Is there a place I can go other then FAQ, Code snipets on the xwiki.org that I can go to look up all this info on syntax and stuff. Sort of a how to learning book is what I'm looking for but can't seem to find any useful info besides the devs@ mailing list.
~Grant
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Guillaume Lerouge Sent: Friday, June 04, 2010 09:20 AM To: XWiki Developers Subject: Re: [xwiki-devs] Calling Email from user
Hi,
On Fri, Jun 4, 2010 at 16:11, Sales, G. (Grant) <[email protected]>wrote:
> $xwiki.user.eamil = current user's email address > $xwiki.getLocalUserName($doc.author) = Author's First and Last name > $xwiki.getLocalUserName($doc.creator) = Creator's First and Last
> name > > How would I get the email address for a document author and or > the
> last person that modified the document? > #set($userDoc = $xwiki.getDocument($doc.author)) #set($userObj = $userDoc.getObject('XWiki.XWikiUser')) #set($userProp = $userObj.get('email')) #set($userEmail = $userProp.getValue())
Guillaume
Grant Sales > Security Operations Analyst > ING > 20 Washington Ave South > Minneapolis, MN 55401 > Tel: 612.342.7889 > Fax: 612.342.3428 > Cell: 320.761.0966 > Email: [email protected] > www.ing-usa.com > ING. Your future. Made easier. (r) > > > > --------------------------------------------------------- > > NOTICE: The information contained in this electronic mail > message is confidential and intended only for certain > recipients. If you are
> not an intended recipient, you are hereby notified that any > disclosure, reproduction, distribution or other use of this > communication and any attachments is strictly prohibited. If > you have received this communication in error, please notify the sender > by reply transmission and delete the message without copying or > disclosing it. > > > ==================================================================== > = > = ====================== > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Guillaume Lerouge Sales - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs --------------------------------------------------------- NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it. ======================================================================== ==================== _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (3)
-
Caleb James DeLisle -
Guillaume Lerouge -
Sales, G. (Grant)