Split PLAINTEXT and HTML recipients regardless of fromId
Change-Id: I11b4b926f53e1e5be67193d2d9a90a6d7bd085e6
This commit is contained in:
parent
9146a9508f
commit
de528d3f91
@ -147,23 +147,22 @@ public abstract class OutgoingEmail {
|
||||
//
|
||||
removeUser(fromUser);
|
||||
}
|
||||
|
||||
// Check the preferences of all recipients. If any user has disabled
|
||||
// his email notifications then drop him from recipients' list.
|
||||
// In addition, check if users only want to receive plaintext email.
|
||||
for (Account.Id id : rcptTo) {
|
||||
Account thisUser = args.accountCache.get(id).getAccount();
|
||||
GeneralPreferencesInfo prefs = thisUser.getGeneralPreferencesInfo();
|
||||
if (prefs == null || prefs.getEmailStrategy() == DISABLED) {
|
||||
removeUser(thisUser);
|
||||
} else if (useHtml() && prefs.getEmailFormat() == EmailFormat.PLAINTEXT) {
|
||||
removeUser(thisUser);
|
||||
smtpRcptToPlaintextOnly.add(
|
||||
new Address(thisUser.getFullName(), thisUser.getPreferredEmail()));
|
||||
}
|
||||
if (smtpRcptTo.isEmpty() && smtpRcptToPlaintextOnly.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Check the preferences of all recipients. If any user has disabled
|
||||
// his email notifications then drop him from recipients' list.
|
||||
// In addition, check if users only want to receive plaintext email.
|
||||
for (Account.Id id : rcptTo) {
|
||||
Account thisUser = args.accountCache.get(id).getAccount();
|
||||
GeneralPreferencesInfo prefs = thisUser.getGeneralPreferencesInfo();
|
||||
if (prefs == null || prefs.getEmailStrategy() == DISABLED) {
|
||||
removeUser(thisUser);
|
||||
} else if (useHtml() && prefs.getEmailFormat() == EmailFormat.PLAINTEXT) {
|
||||
removeUser(thisUser);
|
||||
smtpRcptToPlaintextOnly.add(
|
||||
new Address(thisUser.getFullName(), thisUser.getPreferredEmail()));
|
||||
}
|
||||
if (smtpRcptTo.isEmpty() && smtpRcptToPlaintextOnly.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user