Email 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

Email notification

Post by Moh Youba » 2019-09-10 21:48

Hello

I am looking for a help to send email notification once a record is added.

For example, a user add a data, admin receive a message, something like " Hello, a new record just added by 'username'".

Thank you

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

Re: Email notification

Post by Moh Youba » 2019-09-10 22:52

Hello
By following a post on the forum I find this code
code.jpg
code.jpg (133.83 KiB) Viewed 2781 times
but when I try I get this error, any help please
errors.jpg
errors.jpg (17.75 KiB) Viewed 2781 times
Thank you

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

Re: Email notification

Post by Moh Youba » 2019-09-10 22:59

got it, here the correct code

foreach($data as $field => $value){
$messageData .= "$field: $value \n";
}

sendmail(array(
'to' => '[email protected]',
'name' => 'Mohamed Youba',

'subject' => 'Transfert',

'message' => "Un transfert a été envoyé par {$memberInfo['username']}: \n\n" . $messageData
));

return TRUE;
}

Thanks

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

Re: Email notification

Post by Moh Youba » 2019-10-22 23:04

Hello

Any help please. I got this working well, but now I need notification to be sent only every week or month

Thank you

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Email notification

Post by onoehring » 2019-10-23 14:14

Hi Moh,

do you want the email after insert (as seen in screenshot) or at certain time intervals?
If time intervals, I suggest writing that piece of code in a seperate .php file and then use a simple cron (Linux) or at (windows) to call that script.
If you have no cron available, you could sign up for free here: https://www.cronjob.de

Olaf

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

Re: Email notification

Post by Moh Youba » 2019-10-23 14:16

Hi Olaf

I want to send the email with interval, for example every week
I am going to have a look on your link

Thank you

Post Reply