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 @@ -63,11 +63,6 @@ fn render_template(
6363 EMAIL_ENV . get_template ( template_name) ?. render ( context)
6464}
6565
66- pub trait Email {
67- fn subject ( & self ) -> String ;
68- fn body ( & self ) -> String ;
69- }
70-
7166#[ derive( Debug , Clone ) ]
7267pub struct EmailMessage {
7368 pub subject : String ,
@@ -86,16 +81,6 @@ impl EmailMessage {
8681 }
8782}
8883
89- impl Email for EmailMessage {
90- fn subject ( & self ) -> String {
91- self . subject . clone ( )
92- }
93-
94- fn body ( & self ) -> String {
95- self . body_text . clone ( )
96- }
97- }
98-
9984#[ derive( Debug , Clone ) ]
10085pub struct Emails {
10186 backend : EmailBackend ,
@@ -196,8 +181,8 @@ impl Emails {
196181 Ok ( message)
197182 }
198183
199- pub async fn send < E : Email > ( & self , recipient : & str , email : E ) -> Result < ( ) , EmailError > {
200- let email = self . build_message ( recipient, email. subject ( ) , email. body ( ) ) ?;
184+ pub async fn send ( & self , recipient : & str , email : EmailMessage ) -> Result < ( ) , EmailError > {
185+ let email = self . build_message ( recipient, email. subject , email. body_text ) ?;
201186
202187 self . backend
203188 . send ( email)
You can’t perform that action at this time.
0 commit comments