Custom email template by request Origin
Embedded Genesys is used by more and more genebanks and they'd like to use their own branding when notification emails are sent to requestors.
Several emails are generated in RequestServiceImpl and the branding of the email is applied in EMailServiceImpl with articleService.getGlobalArticle(ContentService.SMTP_EMAIL_TEMPLATE, Locale.ENGLISH).
Since we keep the Origin in MaterialRequest and we could fetch a custom template based on the origin (e.g. template = getGlobalArticle(ContentService.SMTP_EMAIL_TEMPLATE + "." + origin.host, Locale.ENGLISH)) in the Request service. The article loaded here would have slug = "smtp-email-template.host.domain.org" for origin = "https://host.domain.org/" and could be null.
We pass the custom template as an argument in all emailService.sendEmail calls and there we use it as a template, or fall back on the default template if necessary.