package Ġcom . de . c 0 dr . mail service . adapter . primary ; Ċ Ċ import Ġcom . de . c 0 dr . mail service . Mail Application Service Ċ import Ġcom . de . c 0 dr . mail service . adapter . secondary . sending . Mail Sending Adapter Ċ import Ġcom . de . c 0 dr . mail service . adapter . secondary . transp iling . MJ ML Tr ansp iler Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestBody Ċ import Ġorg . springframework . web . bind . annotation . RestController ĊĊ Ċ @ RestController Ċ class ĠMail Request Controller ( private Ġval Ġmail Application Service : ĠMail Application Service , Ġprivate Ġval Ġmail Sending Adapter : ĠMail Sending Adapter , Ġprivate Ġval Ġmail Tr ansp iling Adapter : ĠM J ML Tr ansp iler ) Ġ{ ĊĊĠĠĠ Ġ@ PostMapping ("/ send ") ĊĠĠĠ Ġfun Ġg reeting (@ RequestBody Ġmail Request : ĠMail Request ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġformatted Template Ġ= Ġmail Application Service . generate Template ( mail Request . template Name , Ġmail Request . variables ) ĊĠĠĠĠĠĠĠ Ġval Ġhtml Template Ġ= Ġmail Tr ansp iling Adapter . transp ile ( formatted Template ) ĊĠĠĠĠĠĠĠ Ġmail Sending Adapter . send Mail ( mail Request . recipient , Ġmail Request . subject , Ġhtml Template ) ĊĠĠĠ Ġ} Ċ }