VOI
Member
Hi,
I would like to send an email every time a new entry is added to a repeatable group.
I thought about setting up the condition for the form email plugin as follows:
But when looking at the content of $origData I realised that the repeated elmenents are not represented as arrays - like in $data - but only the elments of the first subgroup are shown.
Is there any other way to set up the condition thus the email is only sent if a new subgroup has been added?
Chris
I would like to send an email every time a new entry is added to a repeatable group.
I thought about setting up the condition for the form email plugin as follows:
Code:
//get the keys of those comments only present in new data, e.g. added
$new_keys = array_diff_key($data['table_826_repeat___id'], $origData['table_826_repeat___id']));
//if no new keys then dont send mail
return !empty($new_keys);
But when looking at the content of $origData I realised that the repeated elmenents are not represented as arrays - like in $data - but only the elments of the first subgroup are shown.
Is there any other way to set up the condition thus the email is only sent if a new subgroup has been added?
Chris