mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-27 08:01:50 +01:00
Added insert template
This commit is contained in:
@@ -77,10 +77,14 @@ public class EntityAnswer implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
String text = answer.text;
|
||||
text = text.replace("$name$", name == null ? "" : name);
|
||||
text = text.replace("$firstname$", first == null ? "" : first);
|
||||
text = text.replace("$lastname$", last == null ? "" : last);
|
||||
return replacePlaceholders(answer.text, name, first, last, email);
|
||||
}
|
||||
|
||||
static String replacePlaceholders(
|
||||
String text, String fullName, String firstName, String lastName, String email) {
|
||||
text = text.replace("$name$", fullName == null ? "" : fullName);
|
||||
text = text.replace("$firstname$", firstName == null ? "" : firstName);
|
||||
text = text.replace("$lastname$", lastName == null ? "" : lastName);
|
||||
text = text.replace("$email$", email == null ? "" : email);
|
||||
|
||||
return text;
|
||||
|
||||
Reference in New Issue
Block a user