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('grant.sales(a)us.ing.com')
## 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: devs-bounces(a)xwiki.org [mailto:devs-bounces@xwiki.org] 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('noreply(a)myserver.com'))
##
## fill in an address which you will see when the mail comes in.
$mailObj.setTo('user(a)localhost.localdomain')
##
## 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.
============================================================================================