Page 1 of 1

User notification

Posted: 2022-07-02 17:13
by Moh Youba
Hello

Any idea on how set these features please.
When we select a user on a case, then I want the user to get an email with all the details of the case or a link to that case number to see all the details and attachments
When we click save then it must email that user.
Then the database must email the user and the admin user when the due date is going to expire.

Using AppGini : 22.14

Thank you

Re: User notification

Posted: 2022-07-02 19:02
by patsd102
Something like this any good?

https://bigprof.com/appgini/tips-and-tu ... ed-records.

I seen on another post, sending to more than one, an array was used

P

Re: User notification

Posted: 2022-07-02 19:27
by Moh Youba
Thank you, going to have a look.

Re: User notification

Posted: 2022-07-02 22:20
by Moh Youba
*any help, whats wrong in this code?*

function gtm_after_insert($data, $memberInfo, &$args) {
sql("update `gtm` set `tax_invo`= 'GT{$data['gtmid']}' where `gtmid` = LAST_INSERT_ID()", $eo);

// send notification to user
foreach($data as $field => $value){
$messageData .= "$field: $value \n";
}

sendmail(array(
'to' => '$userEmail',
'name' => 'GAUTENG TRANSCRIBERS',

'subject' => 'NOTIFICATION',

'message' => "NEW TASK {$memberInfo['username']}: \n\n" . $messageData
));

return TRUE;
}

Re: User notification

Posted: 2022-07-05 05:46
by pbottcher
Hi,

what is the $userEmail? doens not seem to be set at the moment you call it in your script.

Re: User notification

Posted: 2022-07-05 05:58
by jsetzer
Pböttcher is completely right.

Additionally, if you put a variable name in single quotes, this will just result in the variable name, not the variable contents.

After you have set $userEmail variable as pböttcher has suggested, try double quotes.

I recommend the following syntax:

Code: Select all

'to' => "{$userEmail}",

Re: User notification

Posted: 2022-07-05 20:14
by Moh Youba
Thank you guys, going to fix