Sending Mails and Searching Options
mifla
Posted: Thursday, September 25, 2008 1:09:38 PM
Rank: Newbie

Joined: 9/25/2008
Posts: 7
Location: Colombo
Hi All,

I’m a newbie to umbraco. Could someone please enlighten me on the following?

- How can we send mails in umbraco? Each time a new content is created can I send a mail?
I would ideally want to use my own mail format and text for it.

- How do I programmatically perform a search operation on the contents?

Many Thnks
Mifla
Dirk
Posted: Thursday, September 25, 2008 1:36:11 PM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Hi Mifla,

Quote:
How can we send mails in umbraco? Each time a new content is created can I send a mail?


Yes, you can use action handlers to do so. Pre v4 versions only support those, if using a v4+ version, .net events are supported as well.

Others may have answers to the 2nd question.

Hope that helps.

Regards,
/Dirk



level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
dawoe
Posted: Thursday, September 25, 2008 2:07:54 PM

Rank: Aficionado

Joined: 1/19/2008
Posts: 182
Location: Belgium
mifla wrote:
Hi All,

I’m a newbie to umbraco. Could someone please enlighten me on the following?

- How can we send mails in umbraco? Each time a new content is created can I send a mail?
I would ideally want to use my own mail format and text for it.

- How do I programmatically perform a search operation on the contents?

Many Thnks
Mifla


In the backend you can choose "Notifications" in the right click menu. This let's you set a bunch of notifications on a item.

Dave

Converting a DotNetNuke site to Umbraco : Follow it here
Dirk
Posted: Thursday, September 25, 2008 2:23:43 PM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Hi,

Quote:
In the backend you can choose "Notifications" in the right click menu. This let's you set a bunch of notifications on a item


Yep, forgot about that (Much more simple approach and no coding required), but what if he wish to use his own mail format and text? Is that also available?

Greetz,
/Dirk

level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
drobar
Posted: Thursday, September 25, 2008 2:36:52 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Regarding searching... there are a few choices, depending on your needs.

The easiest to use is XSLTsearch, which you can get from the package repository and at http://www.percipientstudios.com/xsltsearch.aspx. Full docs, very customizable. Great for sites under a few thousand pages. Does not search PDFs or Office documents.

If you need more, you'll need the Lucene-based search. John has done great work to add features and explain how to use it. Read all about it at http://forum.umbraco.org/yaf_postst5079p3_Getting-search-to-work--why-is-it-so-freakin-hard.aspx.

There's also a new integration with a Microsoft search tool that Kenny is explaining at http://www.kenny.no/archive/2008/9/25/microsoft-search-server-express-2008-and-umbraco/

So you've got options! Isn't umbraco great?!?

cheers,
doug.

MVP 2007-2009 - Percipient Studios
VirtualRichard
Posted: Thursday, September 25, 2008 4:46:04 PM

Rank: Fanatic

Joined: 9/17/2007
Posts: 265
Location: London, UK.
For sending emails, set up your web config:

Code:
<appSettings>
<add key="umbracoSmtpServer" value="123.123.123.123" />
...
</appSettings>

...with the correct IP of your email server, then in XSLT, all you have to do is:

Code:
<xsl:variable name="SMTPEmail" select="umbraco.library:SendMail($EmailFrom, $EmailTo, $EmailSubject, $EmailBody, 1)"/>


...where the various variables hold your message details. 1 is for send as html email, put 0 if you want just text.

Richard

2 * 3 * 3 * 37 : The prime factorisation of The Beast.
mifla
Posted: Friday, September 26, 2008 10:38:20 AM
Rank: Newbie

Joined: 9/25/2008
Posts: 7
Location: Colombo
Hi All,

Thanks a lot for all the information, I appreciate it a lot.

Actually with respect to search what I was looking at is something like what is explained below,

- I have a content called ‘Course’
- Within this there are child nodes like ‘course1’.’course2’ etc…
- Below each of these students who register for each course are added.

I actually want to be able to populate the courses in a dropdown, so that when someone selects a particular course the relevant students who are registered for this course is displayed in a grid.

What’s the best possible way by which I may achieve this?

Many Thanks,
Mifla
Dirk
Posted: Friday, September 26, 2008 10:59:31 AM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Hi,

If you only need to provide a way of presenting a 'Course' dropdown and a grid of relevant students on postback, I'd go for a simple user control. Populate the dropdown by querying umbraco for all 'Course x' nodes, and on postback, find all nodes that are child nodes of the 'Course x' node.
All this stuff can be done in a programmatic way (Either through a Document object or through a XPath query)

Have a look at the API docss for querying umbraco content.

Don't have any source code laying around, but it's pretty obvious.

I'll see if I can find a post or two to explain how to proceed.

Here's a first that should get you started

Regards,
/Dirk


level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Dirk
Posted: Friday, September 26, 2008 11:10:39 AM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Of course, others may have other options.

I think it's even possible to do this completely using templates/xslt.

Create an xslt to list all 'Course' nodes (Add add them to a dropdown). Create macro that references that xslt. Add macro to desired template (Most probably the template for 'Courses' node)

Add some javascript to act on a selectedIndexChanged event... that takes you to the 'Course' node page. As a 'Course' page is associated with a template (assumption), add another macro (referencing yet another xslt) that lists all 'Student' nodes in a grid.

Hope that helps.

Regards,
/Dirk


level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
VirtualRichard
Posted: Friday, September 26, 2008 11:45:40 AM

Rank: Fanatic

Joined: 9/17/2007
Posts: 265
Location: London, UK.
If you look at the Quick Links on our home page at www.aquaterra.org, those quick links are 100% created from content nodes by XSLT (the editors just create the link with a media picker and the text comes from the document name in the content area) and the functionality was added with jQuery - so yes indeed you can do dropdowns from XSLT no worries.

Actually, there are group document types and quick link document types so the links can be grouped. Remember umbracoNaviHide = Yes so they don't show up where we don't want them and it works really really well as anyone can create quite complicated link groups with no knowledge of coding.

Richard


2 * 3 * 3 * 37 : The prime factorisation of The Beast.
mifla
Posted: Saturday, September 27, 2008 12:32:46 PM
Rank: Newbie

Joined: 9/25/2008
Posts: 7
Location: Colombo
Hi,

Thanks a lot for all the information, im trying to acheive the same by using nodes. I keep on getting this error. I serched the forum,but the answers i found didnt wrk out. Would appreciate if some1 cld help me out on this.

Quote:
The type initializer for 'Nested' threw an exception.


My Code

Code:
umbraco.presentation.nodeFactory.Node n = new umbraco.presentation.nodeFactory.Node(1510);


could someone pls show me the way to get the properties of a document by the way of code?i have tried many samples,but of no avail,they have been returning no properties at all.

i have also tried to get the xml out put of a document,it returns an emty string,but i checked the non-public properties of the doucment i can see the xml,its just that this method doesnt seem to be returning it. Am i missing something?i hve a tight deadline this week , i need to get these resolved. would apprecite if some1 cld kindly answre my queries.

Code:

                XmlDocument xdoc=new XmlDocument();
                tempDocument.ToXml(xdoc, false);


Thnks
Mifla
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.