We currently have a 'resources' page on our website, which allows customers to download whitepapers that we have written.
On the page, it allows the customers to click a 'download' button which then prompts them to enter their name and email saying that we will email the whitepaper to them as well as it downloading.
However, the emails are not sending, and to download the page the customer has to click on 'download' again which isn't very clear.
How can I change it so that once the button is clicked from the submission form, it automatically starts to 1, download the file and 2, sends an email to the customer.
May be better examples and may be more umbraco-centric ones
in that function you can then fire another event to send an email with the document attached; The link below has some general settings and stuff on sending email
Automation email not sending?
Hi there,
We currently have a 'resources' page on our website, which allows customers to download whitepapers that we have written.
On the page, it allows the customers to click a 'download' button which then prompts them to enter their name and email saying that we will email the whitepaper to them as well as it downloading.
However, the emails are not sending, and to download the page the customer has to click on 'download' again which isn't very clear.
How can I change it so that once the button is clicked from the submission form, it automatically starts to 1, download the file and 2, sends an email to the customer.
Any help would be greatly appreciated!
Adam
so lets address this in order. 1 i would write a function that would take over the click event. something along these lines
https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/how-to-add-an-event-handler-using-code
May be better examples and may be more umbraco-centric ones
https://our.umbraco.com/forum/using-umbraco-and-getting-started/87051-how-to-send-and-recieve-emails-in-umbraco-76-starter-kit
3 the last event in the would be the response to download the file
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName)
https://stackoverflow.com/questions/12145390/how-to-set-downloading-file-name-in-asp-net-web-api
is working on a reply...