Page 1 of 1

how to send email only in duplicate case

Posted: Fri Dec 02, 2022 5:55 pm
by amiens80

hi,

i wish to send an email alert only when there is a duplicate record added.
In Email_Sending server event, how to detect that php case ?

My idea was to detect the current_page_id and the presence of table id in the url (because when you hit duplicate button, there is the id record in the url parameter) but it did not work.

$duplicate_case=(CurrentPageID()=="add" && isset($_GET['mytable_id']));
if ($duplicate_case)
die ("ok to send email because duplicate case");
else
die ("you are not in a duplicate case");

The problem is the $_GET variable is not exist anymore in Email_Sending server, so i'm out of idea ....

do you have another solution ?

Best regards


Re: how to send email only in duplicate case

Posted: Fri Dec 02, 2022 6:05 pm
by mobhar

What did you mean by The problem is the $_GET variable is not exist anymore in Email_Sending server ?

Please explain it in more detail. How did you get that $_GET variable while it does exist?


Re: how to send email only in duplicate case

Posted: Sat Dec 03, 2022 9:11 am
by arbei

You should use the data (as function arguments) passed to the Email_Sending server event.