Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How do I send a list a links to files in an emailHow do I send a list a links to files in an email
Previous
 
Next
New Post
4/23/2008 8:44 PM
 

I'm developing a module and one of the things it needs to do is send out emails containing links to files.  I have used DotNetNuke.Common.Globals.LinkClick to create the link like this:

body = "<a href=" + DotNetNuke.Common.Globals.LinkClick(fileID, this.TabId, this.ModuleId, false, true) + ">click here</a>";

However the link thats created is not a full URL address that can be clicked on from the email.  The link looks like:

/DNN/LinkClick.aspx?fileticket=T0JmUAAlJgg%3d&forcedownload=true

But I would like it to be a full URL like:

http://www.mywebsite.com/DNN/LinkClick.aspx?fileticket=T0JmUAAlJgg%3d&forcedownload=true

At the moment I have hardcoded the http://www.mywebsite.com part and prefixed it to the link.  How can I do this without hardcoding it?

 

 
New Post
4/24/2008 3:53 PM
 

Off the top of my head, I can think of two ways to get this. You can append your url with either:

  1. PortalAlias.HTTPAlias
  2. Request.ServerVariables("HTTP_HOST")
 
New Post
4/27/2008 9:08 PM
 

Thanks

I ended up using the Uri.TryCreate function

UriBuilder baseUri = new UriBuilder();

Uri resultUri;

bool success = Uri.TryCreate(baseUri.Uri, DotNetNuke.Common.Globals.LinkClick(linkedFile.fileIDString, this.TabId, this.ModuleId, false, true), out resultUri);

if (success)

{

body += "<a href=" + resultUri.AbsoluteUri + ">" + filename + "</a>";

}

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How do I send a list a links to files in an emailHow do I send a list a links to files in an email


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out