`hasGottenMail` is too strict
brendt opened this issue · comments
There's currently a failing test, because our implementation of User::hasGottenMail
is too strict. It only checks whether a specific mail has been sent, while actually it should (in some cases) take context into account.
For example: the NewRfcMail
should be sent for every RFC.
My proposal is to do the following: add an interface HasMailId
that mailables can implement, it has one method getMailId(): string
that returns a unique id for this mail. For simple mails, we can use self::class
, but for more complex mails, we can add the RFC id to it as well. This mailable ID should be saved in checked for in the mail_type
column.
It's fixed :)