Skip Navigation

[Resolved] How to send a notification before a post expires?

This thread is resolved. Here is a description of the problem and solution.

Problem:
A CRED form publishes posts with an expiry period. How to send a notification to users at some interval before the post expires?

Solution:
There is an option in the notifications to send a notification x minutes before the post expires.

Relevant Documentation:
https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/

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 technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.06 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 19 replies, has 4 voices.

Last updated by Nigel 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#601585

Hi, Nigel is out for a public holiday today and will return tomorrow to continue assisting you. Thanks for your patience during the holiday season!

#601710

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tim

Sorry for the delay getting back to you.

Are your notification emails completely blank?

I've just done some further testing to try and establish what is and is not expected to work. I have ruled out modifying the post expiration time after the form is submitted, that makes no difference.

I included all of the %%placeholder%% fields in the email to confirm which work with a post expiration notification.

The placeholders for the current post work (e.g. %%POST_ID%%, %%POST_TITLE%% etc.).

Views shortcodes do not work unless the id attribute is used with the %%POST_ID%% placeholder, e.g. wpv-post-title id="%%POST_ID%%".

Because of this the id attribute cannot be used to specify the parent post id, and so it is only possible to output fields of the expiring post itself.

There are two placeholder fields to display info from the parent post (%%POST_PARENT_TITLE%% and %%POST_PARENT_LINK%%), but... they don't work. I'm reporting that as a bug.

Regarding your last update, I would expect the title to display, but each of your types fields, are they fields of the post that is expiring (in which case they should be output when using the id="%%POST_ID%%" attribute)? Or are they fields of the parent post (in which case they are inaccessible to notifications, regardless of the above-mentioned bug)?

For this latter point—that fields from parent posts cannot be included in notifications—I've created a feature request.

#601725

Ahhh, bummer, yes the fields I'm trying to send are from the parent post. I suppose if we can get %%POST_PARENT_TITLE%% and %%POST_PARENT_LINK%% to work I could live with that. Any idea when that bug might get fixed?

To your question about the emails, they are not totally blank, they contain the plain text I enter and this field [wpv-post-link id="%%POST_ID%%"] form the child post.

Maybe there's a workaround here? Could I possibly pass some parent post fields to the child post upon submission(using generic fields?), so then those fields would be available for the notification email?

Tim

#601735

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tim

I only reported it this morning and quite a few people are away this week, so it won't get any attention before the new year, and as to how long it takes to resolve I can't say because it depends on what code is affected.

Generic fields as a work-around might be possible.

It would only work if you save the generic fields, i.e. use "persist": 1 in the options so that the field values get saved to the database.

Then, in the notification email you would need to output them using the wpv-post-field shortcode (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-field) with the id="%%POST_ID%%" attribute.

#605333

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tim

Sorry for the delay getting back to you.

This issue will be fixed in the next version of CRED, but in the meantime a patch is available which requires manually updating several files as described in this erratum: https://toolset.com/errata/post_parent_title-placeholder-doesnt-work-in-cred-notification-emails/

Let me know if you apply it and still have problems.