TIP

WE'RE HIRING! 💼

The Solspace team is expanding! If you love Craft CMS and you’re looking for an exciting full-time remote position working on software development for the Freeform and Calendar plugins for Craft and more, we’d love to hear from you!

Check Out Job Listing!

Deleting Submissions By Token

Freeform includes a way for users to delete their own submissions. This can be done with the token feature. A typical setup might have you include a link inside an email notification sent to a user that filled out a form. You would include {{ submission.token }} in the URL you generate that is linked to a template with the below example code to allow the user to delete their own submission.

{% set token = craft.app.request.segment(4) %}

{% if craft.freeform.deleteSubmissionByToken(token) %}
  Removed successfully
{% else %}
  Nothing to remove
{% endif %}
1
2
3
4
5
6
7
Last Updated: 1/14/2020, 3:35:55 PM