Skip Navigation

[Resolved] Notifications on delete Post Type

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Joan 6 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#596718

Hello,

Is there any way to register when a post type is deleted by the user through frontend?

I have a members area where the users can add, edit or delete the post types related to them. The post types can be deleted trough a delete link on a view.

Thanks

#596976

There's not a way to trigger email notifications with a "Delete post" link, only with an actual CRED form. You could use an Edit Post CRED form to accomplish something similar:
- Create an Edit Post CRED form
- Choose status "Draft"
- Autogenerate the form
- Delete all the fields from this generated content except the form messages and submit button fields:

[credform class='cred-form cred-keep-original']
	[cred_field field='form_messages' value='' class='alert alert-warning']
	[cred_field field='form_submit' value='Submit' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']
[/credform]

- Change the text "Submit" to say "Delete Post" or something similar.
- Add your email notification to be sent when the form is submitted.
- Insert this CRED form instead of your delete post link.

Of course, this only sets the post status to "Draft". If you want to trash the post, you must use the cred_save_data API to set a different post status:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

#597811

It works,

Thanks!

Joan

The forum ‘Types Community Support’ is closed to new topics and replies.