Added settings to mail
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
Removed some comments
This commit is contained in:
parent
2a1b5c2518
commit
a5d4044ec8
|
@ -143,13 +143,11 @@ pub mod notification {
|
|||
self.smtp_password.to_string(),
|
||||
);
|
||||
|
||||
// Open a remote connection to gmail
|
||||
let mailer = SmtpTransport::relay(self.smtp_relay.as_str())
|
||||
.unwrap()
|
||||
.credentials(creds)
|
||||
.build();
|
||||
|
||||
// Send the email
|
||||
match mailer.send(&email) {
|
||||
Ok(_) => println!("Email sent successfully!"),
|
||||
Err(e) => panic!("Could not send email: {:?}", e), //Todo: this shouldn't panic
|
||||
|
|
|
@ -7,7 +7,14 @@ fn main() {
|
|||
let parser = ArgumentParser {};
|
||||
let settings = Settings::new(None).unwrap();
|
||||
let console = Console {};
|
||||
let notification = EmailNotification;
|
||||
|
||||
// TODO: maybe not clone here, but reference?
|
||||
let notification = EmailNotification {
|
||||
smtp_relay: settings.email.smtp_relay.clone(),
|
||||
smtp_username: settings.email.smtp_username.clone(),
|
||||
smtp_password: settings.email.smtp_password.clone(),
|
||||
from: settings.email.from.clone(),
|
||||
};
|
||||
let args = std::env::args().collect();
|
||||
let application = Application::new(&settings, &console, ¬ification, parser, args);
|
||||
|
||||
|
|
Loading…
Reference in New Issue