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: 130
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: 130
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 765 times
but when I try I get this error, any help please
errors.jpg
errors.jpg (17.75 KiB) Viewed 765 times
Thank you

Moh Youba
Veteran Member
Posts: 130
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' => '222@222.mr',
'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: 130
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

onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 420
Joined: 2019-05-21 22:42
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
Some postings I was involved, you might find useful:
Backup your database (easy) (viewtopic.php?f=4&t=3341); Improve security / safety against DDOS and brute force (failed) logins (viewtopic.php?f=4&t=3168); Field Permissions (hide / lock fields by usergroup) (viewtopic.php?f=4&t=3308); Custom (error) message (viewtopic.php?f=7&t=1740&p=10871#p10906); Audit Log (viewtopic.php?f=4&t=1369&p=10407); Two Factor Authentication (viewtopic.php?f=7&t=3306&p=11478); Add extra (2nd) SAVE CHANGES button (viewtopic.php?f=2&t=3242&p=11104);

Moh Youba
Veteran Member
Posts: 130
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