-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from mainmatter/send-company-in-name
send company name in sender name if present
- Loading branch information
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,16 +75,17 @@ where | |
} else { | ||
"".to_owned() | ||
}; | ||
let mut subject = if !service.is_empty() && service.to_lowercase() != "other" { | ||
|
||
let subject = if !service.is_empty() && service.to_lowercase() != "other" { | ||
format!("Mainmatter inquiry for {service}") | ||
} else { | ||
"Mainmatter inquiry".to_owned() | ||
}; | ||
|
||
subject = if let Some(company) = payload.company { | ||
format!("{} from {}", subject, company) | ||
let name = if let Some(company) = payload.company { | ||
format!("{} ({}) via mainmatter.com", payload.name, company) | ||
} else { | ||
subject | ||
format!("{} via mainmatter.com", payload.name) | ||
}; | ||
|
||
let data = json!({ | ||
|
@@ -96,7 +97,7 @@ where | |
{ "email": zapier_email } | ||
] | ||
}], | ||
"from": { "email": "[email protected]", "name": format!("{} via mainmatter.com", payload.name) }, | ||
"from": { "email": "[email protected]", "name": name }, | ||
"reply_to": { "email": payload.email, "name": payload.name }, | ||
"subject": subject, | ||
"content": [{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,9 +214,9 @@ async fn it_adds_company_to_the_subject_if_one_is_provided() { | |
{ "email": "[email protected]" } | ||
] | ||
}], | ||
"from": { "email": "[email protected]", "name": "name via mainmatter.com" }, | ||
"from": { "email": "[email protected]", "name": "name (Company) via mainmatter.com" }, | ||
"reply_to": { "email": "[email protected]", "name": "name" }, | ||
"subject": "Mainmatter inquiry from Company", | ||
"subject": "Mainmatter inquiry", | ||
"content": [{ | ||
"type": "text/plain", | ||
"value": "Hi!" | ||
|