User notification

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

User notification

Post by Moh Youba » 2022-07-02 17:13

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

patsd102
Veteran Member
Posts: 142
Joined: 2013-01-15 19:59

Re: User notification

Post by patsd102 » 2022-07-02 19:02

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
23.17

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: User notification

Post by Moh Youba » 2022-07-02 19:27

Thank you, going to have a look.

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: User notification

Post by Moh Youba » 2022-07-02 22:20

*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;
}

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: User notification

Post by pbottcher » 2022-07-05 05:46

Hi,

what is the $userEmail? doens not seem to be set at the moment you call it in your script.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: User notification

Post by jsetzer » 2022-07-05 05:58

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}",
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Moh Youba
Veteran Member
Posts: 228
Joined: 2017-03-12 09:31

Re: User notification

Post by Moh Youba » 2022-07-05 20:14

Thank you guys, going to fix

Post Reply