This is just an informative post for an issue I came across today regarding the “From” email address. I know others have had this issue in the past, but I think the most recent post is over a year old so I can’t reply to it anymore.
In Omeka S, system emails typically come from the Administrator email set in the Global Settings (as mentioned in the post linked above).
In our case, we don’t want the From address to be the Administrator email address. This is because we use an email service to send emails tied to the Omeka S domain that has DKIM and SPF configured and is not the same as the Administrator email domain. I could go into more detail on this if anyone is interested.
An example use case is the Contact Us module which will now send notifications to the Administrator email address (user@gmail.com) from our email service provider address (noreply@our-omeka-s-domain.org).
To accomplish this, we have configured the mail key in the local.config.php file and additionally added the undocumented default_message_options key:
I’d quibble slightly with the “undocumented” nature of that config key, but ultimately the information given is a not-terribly-clear reference to the Laminas docs; the context there is that for everything that the Laminas “Message” class has a setter for, that can be set in default_message_options. Though of course some things like body, etc. would be overwritten if set as a default in that way.
Yes, we should probably move or duplicate the information about that key to the manual from the developer docs. There are a lot of possible keys, most of which most people don’t really need to use, but this is probably one that merits a higher-profile mention.
Worth noting also: for most uses, simply setting your configured administrator email (in the global settings UI) to the necessary address will be all that’s necessary.
Ah, that’s also useful, thanks*! I agree that this setting, although one of the many possibile ones, is one of the most useful and crucial so it’s perhaps worth mentioning it indeed in the user manual too.
although sometimes, like in my case, the email used for authentication is an unmonitored one and created just for that purpose.