I'm taking my first baby steps into the php side of Craft, and my php experience in general is extremely fledgling. But I'm pretty much forced to create a module for a project I have, so here I am flailing around in a space I know virtually nothing about. So thanks for reading.
Basically, I need to send notification emails based on specific (very specific) user actions. Right now I have it running so that I'm catching the
EVENT_AFTER_SAVE event in my module's
init() function and successfully sending out emails with the Mailer. So that's good. But the issue is I need to be able to see if certain fields have changed on entries to know what email to send out.
Is there a way to compare the pre-saved and post-saved entry, or maybe alternatively to catch the fields that are being sent to
/entries/save-entry to determine what the user is doing? I know it's probably likely that what I really should be doing is creating my own controller and/or action that I use on my templates in places that designate what action should be taking place, but I'm so barely holding on to comprehension of what I'm doing as-is that I'd prefer to create something caveman simple first before trying to give it better coding practices. But I'm also open to any advice at all on how to proceed.