Introduced e-mail parsing and minor error handling for encoding or parsing issues
This commit is contained in:
parent
5ac1425b44
commit
ad3245f884
3 changed files with 58 additions and 3 deletions
|
@ -84,7 +84,7 @@ async fn client_from_mxid(mxid: &str, clients: &Vec<Client>) -> Option<Client> {
|
|||
None
|
||||
}
|
||||
|
||||
pub async fn send(from_mail: &Option<Mailbox>, recipient: &Mailbox, content: &str, clients: &Vec<Client>, mappings: &Vec<Mapping>) {
|
||||
pub async fn send(from_mail: &Option<Mailbox>, recipient: &Mailbox, plain_content: &str, html_content: &str, clients: &Vec<Client>, mappings: &Vec<Mapping>) {
|
||||
for mapping in mappings {
|
||||
let mut applies = true;
|
||||
|
||||
|
@ -151,7 +151,7 @@ pub async fn send(from_mail: &Option<Mailbox>, recipient: &Mailbox, content: &st
|
|||
continue;
|
||||
}
|
||||
};
|
||||
match room.send(RoomMessageEventContent::text_html(content, content), None).await {
|
||||
match room.send(RoomMessageEventContent::text_html(plain_content, html_content), None).await {
|
||||
Ok(_) => (),
|
||||
Err(_e) => println!("Sending message failed"),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue