When a user completes a post form on the front end, the first email goes to Admin as a prompt to check and then set post to Published, the second email goes to the user with a copy of the post they've just created. When Admin sets the post to Published, the third email goes to the user, confirming their post is now active.
The first two emails contain all the information they should but in the third email (second one to the user) the user fields are returned empty.
1. I mean the shortcodes I've picked from Fields & Views in the notification mail body.
2. Yes, that's right
3. In the third email I only use [wpv-user field='user_firstname'] but I've just noticed that %%FORM_DATA%% isn't appearing in the email either
4. Here's the content of the notification mail body for the third email:-
[php]<p>Hi [wpv-user field='user_firstname']</p>
<p>I'm pleased to inform you that the booking below is now fully confirmed.</p>
<p>If you need to cancel any of the dates, please make the necessary amendments to your booking form via your <a href="hidden link">account area</a>. If you wish to adjust your deposit accordingly, please add your bank account details to the message box at the bottom of the form and I will arrange the necessary refund. </p>
<p>If you wish to either extend the booking or change both the arrival & collection dates, please check availability with me first.</p>
<p>If you wish to pay the balance by BACS, please ensure this reaches my account by 5pm the day before arrival at the very latest. Alternatively, you can bring cash on the day.</p>
<p>If you have any queries or concerns in the meantime, please do give me a ring.</p>
<p>Best wishes</p>
<p>Julie @ Kennel Free K9s</p>
I set up the [foobar] shortcode, added a notification to my form to a specific email address (non-user) and added [foobar] to the message area. "I am a test shortcode" appeared in the email to the non-user.
As Tia is currently on holiday then I will be handling this ticket on her behalf 🙂
I see that you have the %%FORM_DATA%% code on the 3rd email. Since this email isn't being triggered directly by the CRED form then it won't work.
What you need to do is use the Views and Fields button on the editor to add the appropriate shortcodes to the email.
The %%FORM_DATA%% code will only work if the notification is being triggered by a form submission but in the case of the 3rd email its being triggered on a status update and not a form submission.
Ah OK, yes that does make sense - I can achieve that another way.
I thought one of the fields wasn't populating but when I double checked, the entry for that field was empty so that's explained.
If I may ask one more question relating to this issue please? Should Types fields populate in the email notifications? I've used two (in the first email to admin) that are used in a different form to the one being submitted, but the values don't appear. Does one of the forms need to be a child post of the other for this particular scenario to work (i.e. is that why it isn't working)?
If the email is being generated from the Form then no the types field won't work. We currently have an ongoing issue with this and our developers are working to resolve this.
I'm confused now! All the Types fields I use in the email notifications for my Contact Form return values in the emails. Are you saying the Types fields will only work in the first emails but not in any subsequent one?
yes, they do. In the third email, I've replaced %%FORM_DATA%% with all the Types fields in a table and the values are populated which is why I'm confused about your comment in thread #433752.
My original query is actually resolved but I'd appreciate making sure I've understood everything correctly.
Sorry to labour the point here but I don't agree that Types fields won't work if the email is generated from a form being created (they're working for me!)
My original question has been answered so I'm closing this ticket.
Thanks for your help.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.