File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,12 @@ impl Emails {
8484 }
8585 }
8686
87- fn build_message < E : Email > ( & self , recipient : & str , email : E ) -> Result < Message , EmailError > {
87+ fn build_message (
88+ & self ,
89+ recipient : & str ,
90+ subject : String ,
91+ body : String ,
92+ ) -> Result < Message , EmailError > {
8893 // The message ID is normally generated by the SMTP server, but if we let it generate the
8994 // ID there will be no way for the crates.io application to know the ID of the message it
9095 // just sent, as it's not included in the SMTP response.
@@ -100,9 +105,6 @@ impl Emails {
100105
101106 let from = Mailbox :: new ( Some ( self . domain . clone ( ) ) , self . from . clone ( ) ) ;
102107
103- let subject = email. subject ( ) ;
104- let body = email. body ( ) ;
105-
106108 let message = Message :: builder ( )
107109 . message_id ( Some ( message_id. clone ( ) ) )
108110 . to ( recipient. parse ( ) ?)
@@ -115,7 +117,7 @@ impl Emails {
115117 }
116118
117119 pub async fn send < E : Email > ( & self , recipient : & str , email : E ) -> Result < ( ) , EmailError > {
118- let email = self . build_message ( recipient, email) ?;
120+ let email = self . build_message ( recipient, email. subject ( ) , email . body ( ) ) ?;
119121
120122 self . backend
121123 . send ( email)
You can’t perform that action at this time.
0 commit comments