Revert "Simplified email placeholders"

This reverts commit c5b35d93fb.
master
M66B 2 weeks ago
parent 3dca573260
commit 09d8ec49fb

@ -865,12 +865,16 @@ public class MessageHelper {
static String replacePlaceholders(String address, EntityMessage message, EntityIdentity identity) throws UnsupportedEncodingException { static String replacePlaceholders(String address, EntityMessage message, EntityIdentity identity) throws UnsupportedEncodingException {
if (hasPlaceholder(address)) { if (hasPlaceholder(address)) {
if (message.from != null && Address from = getFrom(message, identity);
message.from.length == 1 && if (from instanceof InternetAddress) {
message.from[0] instanceof InternetAddress) { String email = ((InternetAddress) from).getAddress();
String email = ((InternetAddress) message.from[0]).getAddress();
String user = UriHelper.getEmailUser(email); String user = UriHelper.getEmailUser(email);
String domain = UriHelper.getEmailDomain(email); String domain = UriHelper.getEmailDomain(email);
if (message.extra != null) {
Pair<String, String> extra = getExtra(email, message.extra);
if (extra.second != null)
email = extra.second;
}
address = address address = address
.replace("$from$", email) .replace("$from$", email)
.replace("$user$", user) .replace("$user$", user)

Loading…
Cancel
Save