fix "from" address parsing
This commit is contained in:
parent
38926b4cda
commit
117ea2c168
|
@ -3,7 +3,7 @@ use std::path::PathBuf;
|
||||||
use failure;
|
use failure;
|
||||||
use handlebars::Handlebars;
|
use handlebars::Handlebars;
|
||||||
use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTransport};
|
use lettre::{Transport as LettreTransport, SendmailTransport, file::FileTransport};
|
||||||
use lettre_email::EmailBuilder;
|
use lettre_email::{Mailbox,EmailBuilder};
|
||||||
use url;
|
use url;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ mod context {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Service {
|
pub struct Service {
|
||||||
from: String,
|
from: Mailbox,
|
||||||
base_uri: String,
|
base_uri: String,
|
||||||
domain: String,
|
domain: String,
|
||||||
templates: Handlebars,
|
templates: Handlebars,
|
||||||
|
@ -63,7 +63,7 @@ impl Service {
|
||||||
?.host_str().ok_or_else(|| failure::err_msg("No host in base-URI"))
|
?.host_str().ok_or_else(|| failure::err_msg("No host in base-URI"))
|
||||||
?.to_string();
|
?.to_string();
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
from: from,
|
from: from.parse().unwrap(),
|
||||||
base_uri: base_uri,
|
base_uri: base_uri,
|
||||||
domain: domain,
|
domain: domain,
|
||||||
templates: templates,
|
templates: templates,
|
||||||
|
|
Loading…
Reference in New Issue