[Building Sakai] Using the EmailTemplateService

Steve Swinsburg steve.swinsburg at gmail.com
Mon Jan 4 00:35:27 PST 2010


Thanks gents,

I did notice the parts in site-manage but wasn't sure if that was the current state of how it was to be implemented so thought best to check.

For elegance, what about some wrapper methods that load/update the template for you, given the path of the XML file and some property which says what version it is/last modified date? This is something that would need to be implemented for each tool that uses the ETS so would be a good candidate for an API method in ETS itself.

Also, is it possible to have multiple localised XML files for the one template
ie
myTemplate.xml
myTemplate_en_GB.xml
myTemplate_nl.xml

rather than having all of the various localised versions in the one file?

cheers,
Steve


On 04/01/2010, at 6:42 PM, David Horwitz wrote:

> You Might have a look at the Notification manager in site-manage:
> 
> https://source.sakaiproject.org/svn/site-manage/trunk/site-manage-impl/impl/src/java/org/sakaiproject/sitemanage/impl/ETSUserNotificationProviderImpl.java
> 
> This loads them from an xml file and saves them. Suggestions to make
> this more elegant welcomed :-)
> 
> D
> 
> On 01/04/2010 09:37 AM, Aaron Zeckoski wrote:
>> Mostly just the javadocs really. :-)
>> 
>> The simplest way to do this would be to create a spring bean (or use
>> an existing one) with an init method and then call
>> EmailTemplateService.saveTemplate(EmailTemplate emailTemplate) with
>> the content of your template. This will store the template which you
>> can then use from then on. You could check the date on the template
>> file(s) to see if it had been updated and then update the template(s)
>> in the database. There isn't anything to do this for you in the
>> service though so you will have to write some code to handle it.
>> 
>> Hope that helps.
>> -AZ
>> 
>> 
>> 
>> On Mon, Jan 4, 2010 at 3:55 AM, Steve Swinsburg
>> <steve.swinsburg at gmail.com> wrote:
>> 
>>> Hi all,
>>> 
>>> Are there any docs on how to use the EmailTemplateService?
>>> 
>>> For example, I want to be able to define a template and replacement variables for an email that my tool is to send, and then abstract that out into a file somewhere that can be internationalised. Is there some way to register the new templates that I create with the ETS via Spring?
>>> 
>>> thanks,
>>> Steve
>>> _______________________________________________
>>> sakai-dev mailing list
>>> sakai-dev at collab.sakaiproject.org
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>> 
>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>>> 
>>> 
>> 
>> 
>> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3823 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100104/c9b1b7c2/attachment.bin 


More information about the sakai-dev mailing list