How to identify notifications when sending emails in OMP

Hi,

I found two hooks concerning notifications:

  1. Mail::send
  2. PKPNotificationOperationManager::sendNotificationEmail

When using the second one, I can identify the notification (via $notification->getType()), but in order to change variables of the corresponding emails (e.g. change the email subject of 0x100001F-Notifications), it seems to be necessary to use the Mail::send hook. When using this hook, is there a way to identify the notification? The email key only gives me NOTIFICATION for all kinds of notifications and I couldn’t find a way to get the notification object.

Thanks,
Carola

Hi @carola,

It seems like a bit of a hack, but it should be possible to combine both hooks. The first call could store information about the notification (e.g. to the registry), then the second could look for that information and take the appropriate action if it’s correct.

Regards,
Alec Smecher
Public Knowledge Project Team