Developer forum

Forum » Dynamicweb 10 » Forms Delivery API issue with emails

Forms Delivery API issue with emails

Kevin Steffer
Kevin Steffer
Reply

It doesn't seen that the DeliveryApi can trigger e-mails being sent. 
Then editors can't be notified and the user can't get a reciept. 
 

Are we missing something out or has this been forgotten?


Replies

 
Sigurd Nejrup
Reply

Furthermore we are not able to attach a NotificationSubscriber to form submissions submitted through the delivery API - it only seems to work for submissions submitted through the frontend on a solution. If we can trigger a notification here we can send emails this way, but it seems this is not possible either.

 

Tried with FormOnAfterSubmitSaveSubscriber
Class FormOnAfterSubmitSaveSubscriber | Dynamicweb 10 Developer Documentation

and OnAfterSubmitSave
Class Notifications.FormsViewModelFrontend.OnAfterSubmitSaveArgs | Dynamicweb 10 Developer Documentation

Is there another NotificationSubscriber that is suited for this?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi

This is somewhat undocumented - but it should work like this.

In settings create a form settings instance that defines what should happen when a form is submitted - like when you insert a form on a paragraph

 

That will give you a settings ID:

That setting id can be used with the POST endpoint that takes a setting.

And true - notifications are not fired in this context.

BR Nicolai

Votes for this answer: 1
 
Tobias Nordvig
Reply

Hi Nicolai 

Using the POST endpoint with the setting ID works great and a mail is sent, however I am having a hard time getting values from the form into the mail. 
I've initially tried a Swift email page with template tags like; {{Form.Field.[SystemName].Value}}, {{Global:Request.Host}} and {{Form.Name}} but I am not getting any values in the mail. The same page works when posting the form from the frontend. 
Same goes for the 'Automatic' setting and some of the older standard templates. Both .html and .cshtml. 

Do you know if it's an error on my end or is there a bug somewhere? 

Thanks 
Tobias 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Tobias

It is a viewmodel template - so like this in the top of the template:

@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Forms.FormReceiptViewModel>

https://doc.dynamicweb.dev/api/Dynamicweb.Forms.FormReceiptViewModel.html

 
Tobias Nordvig
Reply

Thanks Nicolai
Works perfectly! 

//Tobias 

 

You must be logged in to post in the forum