File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,6 @@ fn render_template(
5959 EMAIL_ENV . get_template ( template_name) ?. render ( context)
6060}
6161
62- pub trait Email {
63- fn subject ( & self ) -> String ;
64- fn body ( & self ) -> String ;
65- }
66-
6762#[ derive( Debug , Clone ) ]
6863pub struct EmailMessage {
6964 pub subject : String ,
@@ -82,16 +77,6 @@ impl EmailMessage {
8277 }
8378}
8479
85- impl Email for EmailMessage {
86- fn subject ( & self ) -> String {
87- self . subject . clone ( )
88- }
89-
90- fn body ( & self ) -> String {
91- self . body_text . clone ( )
92- }
93- }
94-
9580#[ derive( Debug , Clone ) ]
9681pub struct Emails {
9782 backend : EmailBackend ,
@@ -192,8 +177,8 @@ impl Emails {
192177 Ok ( message)
193178 }
194179
195- pub async fn send < E : Email > ( & self , recipient : & str , email : E ) -> Result < ( ) , EmailError > {
196- let email = self . build_message ( recipient, email. subject ( ) , email. body ( ) ) ?;
180+ pub async fn send ( & self , recipient : & str , email : EmailMessage ) -> Result < ( ) , EmailError > {
181+ let email = self . build_message ( recipient, email. subject , email. body_text ) ?;
197182
198183 self . backend
199184 . send ( email)
You can’t perform that action at this time.
0 commit comments