I have emails sent to several people when a record is created or updated. I needed to have a link to the record sent in the email but the tutorial for sending emails with hooks didn't have it included, and the tutorial that did have it was old, using pre-hooks variables and functions.
I thought I'd document it for all. Even though it's drop-dead simple, it took me a while to get it right.
This is the tutorial code:
Code: Select all
// message
"The following new record was submitted by {$memberInfo['username']}: \n\n".
$messageData,
Code: Select all
// message
"The following new record was submitted by {$memberInfo['username']} at \n\n http://mydomain.com/app/tablename_view.php?SelectedID=".$data['selectedID']." \n\n".
$messageData,