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 @@ -61,11 +61,6 @@ fn render_template(
6161 EMAIL_ENV . get_template ( template_name) ?. render ( context)
6262}
6363
64- pub trait Email {
65- fn subject ( & self ) -> String ;
66- fn body ( & self ) -> String ;
67- }
68-
6964#[ derive( Debug , Clone ) ]
7065pub struct EmailMessage {
7166 pub subject : String ,
@@ -84,16 +79,6 @@ impl EmailMessage {
8479 }
8580}
8681
87- impl Email for EmailMessage {
88- fn subject ( & self ) -> String {
89- self . subject . clone ( )
90- }
91-
92- fn body ( & self ) -> String {
93- self . body_text . clone ( )
94- }
95- }
96-
9782#[ derive( Debug , Clone ) ]
9883pub struct Emails {
9984 backend : EmailBackend ,
@@ -194,8 +179,8 @@ impl Emails {
194179 Ok ( message)
195180 }
196181
197- pub async fn send < E : Email > ( & self , recipient : & str , email : E ) -> Result < ( ) , EmailError > {
198- let email = self . build_message ( recipient, email. subject ( ) , email. body ( ) ) ?;
182+ pub async fn send ( & self , recipient : & str , email : EmailMessage ) -> Result < ( ) , EmailError > {
183+ let email = self . build_message ( recipient, email. subject , email. body_text ) ?;
199184
200185 self . backend
201186 . send ( email)
You can’t perform that action at this time.
0 commit comments