Send Email function Tickets_after_insert

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
jfehr
Posts: 11
Joined: 2022-01-25 17:03

Send Email function Tickets_after_insert

Post by jfehr » 2023-11-22 02:47

Hi how can i or the best way to send an email to someone after function Table_after_insert($data, $memberInfo, &$args)

G Belgrado
Veteran Member
Posts: 61
Joined: 2017-03-12 09:24

Re: Send Email function Tickets_after_insert

Post by G Belgrado » 2023-11-22 08:37

Code: Select all

function tablename_after_insert($data, $memberInfo, &$args){
 
    // to compose a message containing the submitted data,
    // we need to iterate through the $data array
    foreach($data as $field => $value){
        $messageData .= "$field: $value \n";
    }
 
    sendmail(array(
        'to' => '[email protected]',
        'name' => 'Recipient Name',
         
        'subject' => 'A new record needs your attention',
         
        'message' => "The following new record was submitted by {$memberInfo['username']}: \n\n" . $messageData
    ));
     
    return true;
}
https://bigprof.com/appgini/help/advanc ... ter_insert

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

Post Reply