Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
Client is sending a notification and needs to update the post after the notification has been sent, and wants to know which are the last hooks that can be used.
This support ticket is created Il y a 6 années et 4 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
I'm sending the notification to the admin and to the email address from the field in the form, not the "post author", and the email is being sent to both.
I would first use a plugin like WP Mail Logging to check what's being sent (rather than what it being received). On my test site both email addresses are added to the To: field.
My mail debug log only shows the one email being sent but I can see (now) why it's working for you and not me; I always have one notification per recipient generally because the message I send to the user is different to the message I send to myself. For this particular scenario, it's not actually not overly important.
I really appreciate your help with this, thank you!
Before I close this ticket, can I ask (as it's related); is it even possible to display different content to the two recipients in the email body? I'm not quite sure how wpv-conditional would work here (I did try using it by targeting my user ID but only the user's message displayed).
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
You send two notifications, one to yourself (the admin) and one to the person submitting the form.
And the problem is that the first notification deletes the email address before the second one gets to use it, is that right?
Well, the arguments for cred_mail_header include the notification name & number, so you can target just one of the notifications.
If you do a few tests and find that the admin notification consistently happens before the client notification you can specify in your code the notification name of the client notification and only then delete the email address.
Ah OK; I was looking to achieve it in the wrong place! Notification name I can find but where do I find the number (that would be the better one to target in case I change the name)? I've looked in the serialized data but nothing's obvious.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Uhm, I'm not sure!
I suggest you simply output the notification number argument to your debug.log and you will see.
Note that these hooks used to only have the notification number, but that could change when migrating sites and so the notifications would no longer work, hence the notification slug was added to avoid this potential issue.
Ha Ha - that made me laugh! I'll give it go. I can confirm in the meantime that targeting the notification name in the code works so I'm well happy - thank you!!