When storing the email templates with the additional language argument, it's possible to get an error when using the EmailTemplate.get_by_label function (without passing the language argument).
It allows e.g. creating a template for multiple languages with the same label. But when reading them without the language argument you'd receive a list and not Sihl_email.Template.t option Lwt.t as it is now.
This is an edge case and could be a wanted exception. Either both (create and get) have to use the language argument or neither of them. (Sorry, I missed adding this test)
I'd suggest keeping the signature and writing a warning to the console, that the function was called without the needed language argument (and returning Lwt.return_none).
@joseferben ping
When storing the email templates with the additional
languageargument, it's possible to get an error when using theEmailTemplate.get_by_labelfunction (without passing thelanguageargument).It allows e.g. creating a template for multiple languages with the same label. But when reading them without the language argument you'd receive a list and not
Sihl_email.Template.t option Lwt.tas it is now.This is an edge case and could be a wanted exception. Either both (create and get) have to use the language argument or neither of them. (Sorry, I missed adding this test)
I'd suggest keeping the signature and writing a warning to the console, that the function was called without the needed language argument (and returning
Lwt.return_none).@joseferben ping