Developer forum

Forum » CMS - Standard features » Send email with attachment

Send email with attachment

Adrian Ursu
Reply

Hi Guys,

I need to add some functionality to one of our projects.

1. First one is printable version. I want to avoid using print.css and I was thinking I should save the page as PDF. I know I can generate the page by using ?pdf=tru but I don;t know if there is an option to save the PDF somewhere in the filesystem with a specific name

2. Send to friend. I need to allow users to send an email to someone and attach a file (the above generated file) to that email. Is that possible using standard DW functionality?

Any other ideas are welcomed.

Thanks,

Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

One simpler approach in these webdays, would be sending a link to the page with the content. If it is personalized and 'secret' content, use a token so the URL cannot be guessed.

Also, if the content is generated by a page in Dynamicweb, why not generate the HTML in email format and send it as HTML?

Sending a PDF makes more sense if you have it already - but no need to create a PDF from HTML and send it off as an email that understands HTML already...

?pdf=true cannot save to a file.

If you could add some more information on the user story - what is being send by who and is it frontend/backend, I can help sketching a solution. I think the new forms module can be used.

BR Nicolai

 
Adrian Ursu
Reply

Well, it's not that simple.

We have a page where we display search results. The search results are agregated based on some data from DW and some Live Data from NAV.

The data is displayed in a tabel generated and controled with KendoUI.

What we need is to print/download/send to email just the results displayed, not the entire page.

I have some complicated ideas about how to do that but I need to know first what options I have on DW part.

Can I use the API to send an email with an attachment?

Can I use the API to save a PDF?

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You can send emails using the EmailHandler:

http://developer.dynamicweb.com/api8/#Dynamicweb~Dynamicweb.EmailHandler.html

You cannot create PDF's using the API. Because of licensing issues we cannot make that part public.

But still, if you can create the PDF, you can create a HTML email. It is the same thing....

Simply make a pageview instance using the ID of the page with the content - give it a layout template that fits an email, and send it out...

Nicolai

 

 

You must be logged in to post in the forum